Jump to content

Using mysql_num_rows with JOIN problem


Aureole

Recommended Posts

Here's a lovely problem for you while I go eat dinner. ;D

 

<?php
$query ="SELECT * FROM replies INNER JOIN members ON members.mem_id=replies.reply_author_id WHERE reply_parent_id='{$t_id}' ORDER BY reply_id ASC";
$result = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($result) == 0) {
// CODE BLOCK 1
}
else {
// CODE BLOCK 2
}
?>

 

There are no replies yet the above is executing CODE BLOCK 2 where it should be executing CODE BLOCK 1, you follow?

Link to comment
https://forums.phpfreaks.com/topic/72484-using-mysql_num_rows-with-join-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.