Jump to content

Archived

This topic is now archived and is closed to further replies.

homchz

Record Set Issue

Recommended Posts

I have a record set of a SQL query

 

the query looks like this:

 

SELECT C.equipmentaccount,

C.company_name,

C.address,

C.city,

C.zip_code,

C.phone_number,

E.make,

E.modelnumber,

E.serialnumber,

E.deliverydate,

C.state,

C.contact_name,

C.account_type,

C.email,

C.fax_number,

C.phone_number2,

C.partsaccount

FROM customer_info C

LEFT

JOIN equipment E

ON (E.equipaccount = C.equipmentaccount)

WHERE

(

(C.phone_number = '603-448-1134')

)

 

It works in great in a query builder, and works fine when I use the query as written in DMX2004

but what I want to do is have the WHERE command entered in a search field.

 

I am pulling information from two tables in one database. When I am done with the PHP code and query it looks like this.

 

 

 

$colname_Recordset1 = "1";

if (isset($_POST['Eaccount'])) {

$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_POST['Eaccount'] : addslashes($_POST['Eaccount']);

}

mysql_select_db($database_connCustomerInfo, $connCustomerInfo);

$query_Recordset1 = sprintf("SELECT C.equipmentaccount,

C.company_name,

C.address,

C.city,

C.zip_code,

C.phone_number,

E.make,

E.modelnumber,

E.serialnumber,

E.deliverydate,

C.state,

C.contact_name,

C.account_type,

C.email,

C.fax_number,

C.phone_number2,

C.partsaccount

FROM customer_info C

LEFT JOIN equipment E ON (E.equipaccount = C.equipmentaccount)

WHERE C.equipmentaccount = '%s' ", $colname_Recordset1);

$Recordset1 = mysql_query($query_Recordset1, $connCustomerInfo) or die(mysql_error());

$row_Recordset1 = mysql_fetch_assoc($Recordset1);

$totalRows_Recordset1 = mysql_num_rows($Recordset1);

 

While this works great WHEN the customer has equipment to find, but if there is nothing in the equipment table for the searched customer it displays nothing.

 

Any help would be appreciated.

Josh

 

Share this post


Link to post
Share on other sites

Nevermind fixed my issue. :rolleyes:

 

If you are having problems with record sets in DMX2004 not acting like they should be sure you are syncronizing your site to the testing server. :rolleyes:

 

It was not untill I deleted everything and notice the behavors still worked on test that I figured it out. banghead.gif

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.