Bullet Posted April 18, 2009 Share Posted April 18, 2009 I'm trying a MYSQL in PHP, here is the MYSQL code (correct): $replys=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$fo->id'")); I'm trying to make it so I can get the number of replys id topic $fo->id. The MYSQL is fully correct. I have posted the outcome as: echo"<td class='area'>$fo->made </td> <td class='area'>$replys</td></tr>"; But this is not working and it says 0, any helps. Thanks all. and yes I have replys in the topics. Link to comment https://forums.phpfreaks.com/topic/154680-solved-not-fetching/ Share on other sites More sharing options...
premiso Posted April 18, 2009 Share Posted April 18, 2009 $result = mysql_query("SELECT count(idto) FROM replys WHERE idto='$fo->id'"); $replys = mysql_result($result, 0, 0); Should do what you want. Link to comment https://forums.phpfreaks.com/topic/154680-solved-not-fetching/#findComment-813394 Share on other sites More sharing options...
Bullet Posted April 18, 2009 Author Share Posted April 18, 2009 Thanks it has worked! Link to comment https://forums.phpfreaks.com/topic/154680-solved-not-fetching/#findComment-813407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.