Jump to content

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


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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.