Re: [php] if $sql has returned something
| From: | BAO RuiXian | Date: | Wed, 25 Feb 2004 17:33:37 +0000 |
| Subject: | Re: [php] if $sql has returned something | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178858@lists.php.net to get a copy of this message | ||
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 ??) This will do:if ($sql) Best Bao
{echo "<td><a href=\"\">$day</a></td>"; }else{ echo "<td>$day</td>"; } How do I code to know if $sql has returned something? Thanks, John P.S. Greg, Thanks. I'm going to try to do this on my own. If not, I will look at that. Thanks much for the reply.http://pear.php.net/Calendar Regards, Greg