Re: [PHP] numrows
This is the error I get. I tested in MYSQLadmin and there it works. I think there is something with numrows. MySQL Query Failed. Error 1030: Got error -1 from table handler Message-ID: <[EMAIL PROTECTED]> Date: Thu, 23 Aug 2001 10:11:17 -0700 (PDT) From: "ERISEN, Mehmet Kamil" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [PHP] numrows Hello, Chris, with all due respect, DESC is a reserved word for SQL. is english ORDER BY ID DESC meand sort by id in descending order. Martin, your SQL seems to be fine. Are you sure that you are connected to your database. I have run the following SQL against my database SELECT * FROM users WHERE username <> '1' AND user_id < 250 ORDER BY user_id DESC and it returned back records. SO SQL syntax is fine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
Hello, Chris, with all due respect, DESC is a reserved word for SQL. is english ORDER BY ID DESC meand sort by id in descending order. Martin, your SQL seems to be fine. Are you sure that you are connected to your database. I have run the following SQL against my database SELECT * FROM users WHERE username <> '1' AND user_id < 250 ORDER BY user_id DESC and it returned back records. SO SQL syntax is fine. --- Chris Fry <[EMAIL PROTECTED]> wrote: > Should be ORDER BY ID, DESC > > Chris > > Martin Kampherbeek wrote: > > > What's wrong with this? I get the error: Warning: > Supplied argument is not a valid MySQL result resource in > /home/sites/site49/web/vragen/vragen.php on line 42 > > > > $query = "SELECT * FROM question WHERE answer<>'1' AND > id>250 ORDER BY id DESC"; > > > > $result = MYSQL_QUERY($query); > > > > $number = MYSQL_NUM_ROWS($result); > > -- > > Chris Fry > Quillsoft Pty Ltd > Specialists in Secure Internet Services and E-Commerce > Solutions > 10 Gray Street > Kogarah > NSW 2217 > Australia > > Phone: +61 2 9553 1691 > Fax: +61 2 9553 1692 > Mobile: 0419 414 323 > eMail: [EMAIL PROTECTED] > http://www.quillsoft.com.au > > You can download our Public CA Certificate from:- > https://ca.secureanywhere.com/htdocs/cacert.crt > > ** > > This information contains confidential information > intended only for > the use of the authorised recipient. If you are not an > authorised > recipient of this e-mail, please contact Quillsoft Pty > Ltd by return > e-mail. > In this case, you should not read, print, re-transmit, > store or act > in reliance on this e-mail or any attachments, and should > destroy all > copies of them. > This e-mail and any attachments may also contain > copyright material > belonging to Quillsoft Pty Ltd. > The views expressed in this e-mail or attachments are the > views of > the author and not the views of Quillsoft Pty Ltd. > You should only deal with the material contained in this > e-mail if > you are authorised to do so. > > This notice should not be removed. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
better late than never :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
Sorry - it's late! "I knew that" he said. Raphael Pirker wrote: > Hi Chris, > FYI: > > "Chris Fry" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Should be ORDER BY ID, DESC > > actually it shouldn't be this way, since DESC is an option of the ORDER BY > command meaning DESC... > > ORDER BY [column] [ASC | DESC] (ASC is default) > > so the original code was correct > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
Hi Chris, FYI: "Chris Fry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Should be ORDER BY ID, DESC actually it shouldn't be this way, since DESC is an option of the ORDER BY command meaning DESC... ORDER BY [column] [ASC | DESC] (ASC is default) so the original code was correct -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
i'd have a look at the table structure. also if you're using <> to denote inequality then use != both of the previous posts are incorrect Steve "Chris Fry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Should be ORDER BY ID, DESC > > Chris > > Martin Kampherbeek wrote: > > > What's wrong with this? I get the error: Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site49/web/vragen/vragen.php on line 42 > > > > $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id DESC"; > > > > $result = MYSQL_QUERY($query); > > > > $number = MYSQL_NUM_ROWS($result); > > -- > > Chris Fry > Quillsoft Pty Ltd > Specialists in Secure Internet Services and E-Commerce Solutions > 10 Gray Street > Kogarah > NSW 2217 > Australia > > Phone: +61 2 9553 1691 > Fax: +61 2 9553 1692 > Mobile: 0419 414 323 > eMail: [EMAIL PROTECTED] > http://www.quillsoft.com.au > > You can download our Public CA Certificate from:- > https://ca.secureanywhere.com/htdocs/cacert.crt > > ** > > This information contains confidential information intended only for > the use of the authorised recipient. If you are not an authorised > recipient of this e-mail, please contact Quillsoft Pty Ltd by return > e-mail. > In this case, you should not read, print, re-transmit, store or act > in reliance on this e-mail or any attachments, and should destroy all > copies of them. > This e-mail and any attachments may also contain copyright material > belonging to Quillsoft Pty Ltd. > The views expressed in this e-mail or attachments are the views of > the author and not the views of Quillsoft Pty Ltd. > You should only deal with the material contained in this e-mail if > you are authorised to do so. > > This notice should not be removed. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] numrows
Should be ORDER BY ID, DESC Chris Martin Kampherbeek wrote: > What's wrong with this? I get the error: Warning: Supplied argument is not a valid >MySQL result resource in /home/sites/site49/web/vragen/vragen.php on line 42 > > $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id DESC"; > > $result = MYSQL_QUERY($query); > > $number = MYSQL_NUM_ROWS($result); -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] numrows
What's wrong with this? I get the error: Warning: Supplied argument is not a valid MySQL result resource in /home/sites/site49/web/vragen/vragen.php on line 42 $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id DESC"; $result = MYSQL_QUERY($query); $number = MYSQL_NUM_ROWS($result);