homchz Posted January 28, 2004 Share Posted January 28, 2004 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 Quote Link to comment https://forums.phpfreaks.com/topic/1636-record-set-issue/ Share on other sites More sharing options...
homchz Posted January 28, 2004 Author Share Posted January 28, 2004 Nevermind fixed my issue. 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. It was not untill I deleted everything and notice the behavors still worked on test that I figured it out. Quote Link to comment https://forums.phpfreaks.com/topic/1636-record-set-issue/#findComment-5374 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.