mysql_num_rows
| From: | Lauri Vain | Date: | Wed, 29 Nov 2000 07:09:13 +0000 |
| Subject: | mysql_num_rows | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27782@lists.php.net to get a copy of this message | ||
Hello,
Please check out my code below. Yes, I know it's not very pretty at this stage
but I need to deliver an example of how it'll work really soon (few hours).
******************************** SNIP ********************************
$viewposts="SELECT * FROM kiba_trade_offer WHERE
((trade_messtype='parent')&&(trade_viewtype='public')";
if($filter != ""){
if($types != ""){
if(($types == "buy")||($types == "sell")||($types ==
"biz")){$viewposts .=
"&&(trade_type='$types')";};
};
if($levels != ""){
if(($levels == "public")||($levels == "agents")){$viewposts .=
"&&(trade_viewtype='$levels')";};
};
};
$viewposts .= ") ORDER BY trade_id DESC;";
$results=mysql_query($viewposts);
$loendur = mysql_num_rows($results);
echo ("--- $numofrows ---");
while ($myrow = mysql_fetch_array($results)) { / . . . show the results . .
. /}
******************************** SNIP ********************************
Now, the while loop gives me five rows. What's wrong, the mysql_num_rows
doesn't print anything, not even a zero?
Thanks,
Lauri Väin