Re: [php] if $sql has returned something

From: Date: Wed, 25 Feb 2004 17:38:32 +0000
Subject: Re: [php] if $sql has returned something
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-178859@lists.php.net to get a copy of this message
On Thursday 26 February 2004 01:31, John Taylor-Johnston wrote: > I'm trying to figure out something. I found some calendar making code. For > each table cell, I want to add <a href="">$day</a> around $day if an > entry > exists in $db.$table > > $sql = 'SELECT * FROM '.$db.'.'.$table.' where eventid like > '.$eventid.';'; > > if ($sql ??) > {echo "<td><a href=\"\">$day</a></td>"; > }else{ > echo "<td>$day</td>"; > } > > How do I code to know if $sql has returned something? It seems that you're not familiar with accessing databases using PHP. I strongly suggest that you follow some tutorials on the subject before trying to write your own code. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Sin boldly. -- Martin Luther */

« previous php.general (#178859) next »