multiple queries

From: Date: Fri, 11 Feb 2000 04:24:02 +0000
Subject: multiple queries
Groups: php.version4 
Request: Send a blank email to php-version4+get-10085@lists.php.net to get a copy of this message
I am trying to query three different table of the same databsae, each output of the query is in an if statement, now each statement works seperately but when i place all three in a row as shown only the first one gets executed..please help!!!!! (im a newbie too! :o) <? $specialQuery = "SELECT * FROM specialReport where showw = '1' order by reportDate desc" ; $specialResult = MYSQL_QUERY($specialQuery); $specialNumber = MYSQL_NUMROWS($specialResult);?> <? IF ($specialNumber > 0) : WHILE ($i < 1): $title = mysql_result($specialResult,$i,"title"); $entryID = mysql_result($specialResult,$i,"entryID");?> <li><strong>FREE...</strong>Scott Fraser's latest Special Reports and News Releases - view the most recent posting:<? echo "<a href=\"specialReportOutput.cfm?entryID=$entryID\">$title";?></a>.</font><br></li><br> <?$i++; ENDWHILE; ENDIF;?> <? $tncQuery = "SELECT *,DATE_FORMAT(issueDate,'%M %e %Y') AS issueDate2 FROM TNC where showw = '1' order by issueDate desc" ; $tncResult = MYSQL_QUERY($tncQuery); $tncNumber = MYSQL_NUMROWS($tncResult);?> <? IF ($tncNumber > 0) : WHILE ($i < 1): $issueDate = mysql_result($tncResult,$i,"issueDate2"); $entryID = mysql_result($tncResult,$i,"entryID");?> <li><font face="verdana" size="2">Paid subscribers... Access the latest issue of <? echo "<a href=\"TNCOutput.cfm?entryID=$entryID\">";?>the Natural Contrarian Newsletter for <? echo "$issueDate";?></a>.</font></li> <?$i++; ENDWHILE; ENDIF;?> <? $faxQuery = "SELECT *,DATE_FORMAT(issueDate,'%M %e %Y') AS issueDate2 FROM fax where showw = '1' order by issueDate desc" ; $faxResult = MYSQL_QUERY($faxQuery); $faxNumber = MYSQL_NUMROWS($faxResult);?> <? IF ($faxNumber > 0) : WHILE ($i < 1): $issueDate = mysql_result($faxResult,$i,"issueDate2"); $entryID = mysql_result($faxResult,$i,"entryID");?> <li><font face="verdana" size="2">Paid subscribers... Access the latest issue of the <? echo "<a href=\"faxOutput.cfm?entryID=$entryID\">";?>Hot Stock Fax Alert for <? echo "issueDate";?></a>.</font></li> <?$i++; ENDWHILE; ENDIF;?>

« previous php.version4 (#10085) next »