if (perplexed) {post to list}

From: Date: Thu, 07 Sep 2000 23:26:36 +0000
Subject: if (perplexed) {post to list}
Groups: php.db 
Request: Send a blank email to php-db+get-2718@lists.php.net to get a copy of this message
the following code doesn't work right IF the commented lines are included IT DOES echo the "if" statements if the database has no entries for the query, as expected, and it displays SOME of the entries, SOMETIMES if the database does have entries !!! Without the commented lines it displays perfectly, but obviously it would be nice to not display empty tables I seem to have problems with all the different type of "if" structures, my server has PHP ver 3.0.12 , it seems strange such simple looking structure would cause me the headaches it has Is the white space important in this instance? $get_urls = "select * from urls where lev1_id = $L1 and lev2_id = $L2 and lev3_id = $L3 and lev4_id = $L4 order by date desc"; $links = mysql_query($get_urls,$db)or die("cant do main query"); # $check= mysql_fetch_row($links); # if ($check<1) { # echo "<p>No entries in this area Please <a href=\"http://www.retrieversports.net/submissions.htm\">"; # echo "submit</a> any you feel belong here"; # exit; # } echo "<p>The RetrieverSports Net database contains the following links for this topic area</p>"; echo "<p>Please <a href=http://www.retrieversports.net/submissions.htm><b>submit</b></a> any others you feel belong here<p>"; echo "<table border=1 width=85%>"; echo "<tr><th> CLICK to GO</th><th>DESCRIPTION</th></tr>"; while ($row =mysql_fetch_array($links)) { $url = $row["url"]; $url_desc = $row["url_desc"]; echo "<tr><td><center><a href = $url>GO THERE</a></center></td><td><center>$url_desc</center></td></tr>"; } echo "</table>"; echo "<br><P><a href=mailto:badlinks@retrieversports.net>Report bad links</a>, include full and <b>EXACT</b> URL that is not working."; echo "<br>Copy it from the \"address\" (MSIE) or \"location\" (Netscape) field of your browser."; </SCRIPT>

« previous php.db (#2718) next »