GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Sep-2005, 08:23
sanjum sanjum is offline
New Member
 
Join Date: Sep 2005
Posts: 1
sanjum is on a distinguished road

Please check my code it does not fetch any records!


Can someone help me with following code. It does not fetch any record. It is supposed to get bizID, bizName from businesses table by getting bizIDs from the lookup table(busCats)

PHP Code:

<?php require_once('Connections/connSasell.php'); ?>
<?php
$colname_Recordset1 = "1";
if (isset($_GET['catID'])) {
  $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['catID'] : addslashes($_GET['catID']);
}
mysql_select_db($database_connSasell, $connSasell);
$query_Recordset1 = "SELECT businesses.bizID, businesses.bizName FROM businesses, busCats WHERE businesses.bizID IN (' SELECT buscats.bizID FROM buscats WHERE buscats.catID = " . $colname_Recordset1 . "')";
$Recordset1 = mysql_query($query_Recordset1, $connSasell) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>


I am new to PHP aqnd trying to get help from Greamweaver code to create my own code. Your help will be very much appreciated.
Last edited by LuciWiz : 08-Sep-2005 at 08:34. Reason: Please insert your Php code between [php] & [/php] tags; [edited improper title]
  #2  
Old 21-Sep-2005, 03:38
dannybedor dannybedor is offline
New Member
 
Join Date: Jul 2005
Posts: 13
dannybedor is on a distinguished road

Re: mysql query does not fetch records


You should provide more detail about what you get in result, error or just blank page etc.

BTW, I notice this line:
Code:
$query_Recordset1 = "SELECT businesses.bizID, businesses.bizName FROM businesses, busCats WHERE businesses.bizID IN (' SELECT buscats.bizID FROM buscats WHERE buscats.catID = " . $colname_Recordset1 . "')";

Change it to below:
Code:
$query_Recordset1 = "SELECT businesses.bizID, businesses.bizName FROM businesses WHERE businesses.bizID IN (SELECT buscats.bizID FROM buscats WHERE buscats.catID = " . $colname_Recordset1 . ")";
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Formatting C / C++ code WaltP C Programming Language 1 07-Jan-2008 00:59
Guidelines for posting requests for help - UPDATED! WaltP C++ Forum 0 21-Apr-2005 03:44
Problem with int mixed with char,... leitz C++ Forum 17 07-Dec-2004 21:56
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 04:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:11.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.