Jump to content

Total rows for this query should be zero but is equal to "LIMIT"


adrianTNT

Recommended Posts

Hello, I have this code:

 

	mysql_select_db($database_site, $site);
$query_Recordset_queue_to_send = "SELECT * FROM subscriptions_queue ORDER BY subscriptions_queue_id ASC LIMIT 1";
$Recordset_queue_to_send = mysql_query($query_Recordset_queue_to_send, $site) or die(mysql_error());
$row_Recordset_queue_to_send = mysql_fetch_assoc($Recordset_queue_to_send);
$totalRows_Recordset_queue_to_send = mysql_num_rows($Recordset_queue_to_send);

 

The table is empty and I should see $totalRows_Recordset_queue_to_send = 0 but it always returns the same value of the "limit", returns 1 in the above sample.

Anyone knows what I did wrong?

Thank you.

  • 4 months later...

Hello, I have this code:

 

	mysql_select_db($database_site, $site);
$query_Recordset_queue_to_send = "SELECT * FROM subscriptions_queue ORDER BY subscriptions_queue_id ASC LIMIT 1";
$Recordset_queue_to_send = mysql_query($query_Recordset_queue_to_send, $site) or die(mysql_error());
$row_Recordset_queue_to_send = mysql_fetch_assoc($Recordset_queue_to_send);
$totalRows_Recordset_queue_to_send = mysql_num_rows($Recordset_queue_to_send);

 

The table is empty and I should see $totalRows_Recordset_queue_to_send = 0 but it always returns the same value of the "limit", returns 1 in the above sample.

Anyone knows what I did wrong?

Thank you.

 

what exatly is the variable $site?

what exatly is the variable $site?

Hello.

I am not using that generic name as variable, I just replaced site name with $site for this sample.

I probably managed to fix the issue after all, because I dont remember it anymore, oops :)

what exatly is the variable $site?

Hello.

I am not using that generic name as variable, I just replaced site name with $site for this sample.

I probably managed to fix the issue after all, because I dont remember it anymore, oops :)

 

well then you will have to remove it

 

example

$db = @ mysql_connect("$dbpath","$dbuser","$dbpass");
@ mysql_select_db("$dbname",$db);

$db being the connection not the site name

 

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.