affordit Posted February 11, 2008 Share Posted February 11, 2008 I have records that should be displayed but don't and I get no errors can someone tell me what I am missing please? <?php session_start(); // start up your PHP session! include("client_info3.php"); include("top_mid_nav.inc"); include("sharons_dbinfo2.inc.php"); mysql_connect(mysql,$name,$password); mysql_select_db($database) or die( "Unable to select database"); @$query = "Select * from content Where username = '$username' and psword = '$psword'"; $results = mysql_query($query) or die(mysql_error()); $num=mysql_numrows($results); if ($num >0) { print "<table><tr>"; $i = 0; while ($info = mysql_fetch_array($result)) { print "<td width='150' ALIGN='CENTER'>"; echo "<b>"; echo $info['heading']; echo "</b>"; echo "<BR>"; echo $info['picture']; echo "<BR>"; echo $info['description']; echo"<BR></td>"; $i++; if($i % 5 == 0){ echo "</tr><tr>"; } } }else{print "No records available";} ?> Link to comment https://forums.phpfreaks.com/topic/90505-help/ Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 You're missing a "s" for $result while ($info = mysql_fetch_array($results)) { Link to comment https://forums.phpfreaks.com/topic/90505-help/#findComment-464026 Share on other sites More sharing options...
trq Posted February 11, 2008 Share Posted February 11, 2008 Its mysql_num_rows() not mysql_numrows(), you would be getting errors if you enabled them at the top of your script. eg; <?php ini_set('display_errors','1'); error_reporting(E_ALL); ?> Link to comment https://forums.phpfreaks.com/topic/90505-help/#findComment-464028 Share on other sites More sharing options...
affordit Posted February 11, 2008 Author Share Posted February 11, 2008 Thanks guys Link to comment https://forums.phpfreaks.com/topic/90505-help/#findComment-464032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.