RE: [PHP] MySQL QUERY Results Not Appearing[Scanned]

2004-07-02 Thread Michael Egan
Glad to be of help. I'm sure there will be many more occasions when I'm badly in need of assistance. Cheers, Michael -Original Message- From: Harlequin [mailto:[EMAIL PROTECTED] Sent: 02 July 2004 13:55 To: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL QUERY Results Not Appeari

Re: [PHP] MySQL QUERY Results Not Appearing[Scanned]

2004-07-02 Thread Harlequin
PROTECTED] Sent: 30 June 2004 12:42 To: [EMAIL PROTECTED] Subject: [PHP] MySQL QUERY Results Not Appearing[Scanned] Hi all... Despite being able to make a connection to the server and execute a query I am unable to do this through PHP using the following commands: echo "active me

RE: [PHP] MySQL QUERY Results Not Appearing[Scanned]

2004-06-30 Thread Michael Egan
lto:[EMAIL PROTECTED] Sent: 30 June 2004 12:42 To: [EMAIL PROTECTED] Subject: [PHP] MySQL QUERY Results Not Appearing[Scanned] Hi all... Despite being able to make a connection to the server and execute a query I am unable to do this through PHP using the following commands: echo "active m

[PHP] MySQL QUERY Results Not Appearing

2004-06-30 Thread Harlequin
Hi all... Despite being able to make a connection to the server and execute a query I am unable to do this through PHP using the following commands: echo "active members should appear here"; $query = "SELECT * FROM RegisteredMembers"; $result = mysql_query($query) or die ("could not execute qu

Re: [PHP] MYSQL Query results in pages

2004-06-25 Thread Geethanandh Kandasamy
No other way. Use one query to count the total record and then another query for limiting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] R: [PHP] MYSQL Query results in pages

2004-06-25 Thread Alessandro Vitale
the mysql_num_rows() function and it will return the number of total rows rather than just $limit. cheers, Alessandro -Messaggio originale- Da: Matt Matijevich [mailto:[EMAIL PROTECTED] Inviato: giovedi 24 giugno 2004 21.41 A: [EMAIL PROTECTED]; [EMAIL PROTECTED] Oggetto: Re: [PHP] MYSQL

Re: [PHP] MYSQL Query results in pages

2004-06-24 Thread Matt Matijevich
[snip] Is this right? Is there other efficent way to do it? What about if data changes (i.e. new records are added) while the user browses through pages? [/snip] on each page do a: SELECT count(*) FROM table WHERE your_condition this will give you your total number of results -- PHP General Ma

[PHP] MYSQL Query results in pages

2004-06-24 Thread Gus
Hi. I want to query some data in MYSQL and show the results in page order in some fashion (ORDER BY ...) I've been using the LIMIT sentence like this LIMIT offset, max_per_page so if max_per_page = 5 then the first time the sentence will be "LIMIT 0, 5", in page 2 "LIMIT 5,5" and so no.

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Justin French wrote: > $sql = "SELECT * FROM news ORDER BY id DESC LIMIT $limit"; You're forgetting (or just didn't read my code), I'm UPDATE-ing, not SELECT-ing. mysql_num_rows() doesn't work on UPDATE. Anyway, thanks to Rasmus for pointing out my error. -- H | "Life is the art of

Re: [PHP] MySQL query results

2002-03-22 Thread Justin French
FWIW, straight from my code, with a few snips: Justin French -- http://indent.com.au http://soundpimps.com http://hinge.net.au "Ashley M. Kirchner" wrote: > > Rasmus Lerdorf wrote: > > > But did you read the documentation? It states: > > Yes. But, reading it, and my br

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Rasmus Lerdorf wrote: > But did you read the documentation? It states: Yes. But, reading it, and my brain actually registering what I was reading, now that's a different story. :) It _is_ Friday after all. Thanks! -- H | "Life is the art of drawing without an eraser." - John Gardner

Re: [PHP] MySQL query results

2002-03-22 Thread Rasmus Lerdorf
But did you read the documentation? It states: int mysql_affected_rows ( [resource link_identifier]) That's an optional link identifier. You don't feed it a result resource. Just call it without any arguments. The affected rows is tied to a database connection, not a result set. -Rasmus On

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Chris wrote: > oops. i see then my previous mail will not help in this case. wasn't > there something called 'affected_rows'? search the online manual for > 'affected'. I did. Read my reply to Rasmus as well. :) At this rate, I may just say to heck with the $result, and always assume some

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Chris wrote: > > The query does get executed, and the record does get changed. > > seems there is something wrong with the query, can you either echo the query and > feed it directly to mysql, (e.g. in phpmyadmin) see what happens? Nope, the query's fine. I can run it manually, and thro

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Rasmus Lerdorf wrote: > http://www.php.net/manual/en/function.mysql-affected-rows.php Thanks Rasmus. I did try that as well, same result. If I don't bother with the $result, everything's fine. Like I said, the query runs, and gets executed. The DB field gets changed as it should and all.

Re: [PHP] MySQL query results

2002-03-22 Thread Chris
oops. i see then my previous mail will not help in this case. wasn't there something called 'affected_rows'? search the online manual for 'affected'. On 22 Mar 2002 at 17:09, Ashley M. Kirchner wrote: > > After a bit of research: > > -- > Rick Emery wrote: > > > $result = mys

Re: [PHP] MySQL query results

2002-03-22 Thread Rasmus Lerdorf
http://www.php.net/manual/en/function.mysql-affected-rows.php On Fri, 22 Mar 2002, Ashley M. Kirchner wrote: > > After a bit of research: > > -- > Rick Emery wrote: > > > $result = mysql_query(.)' > > mysql_num_rows($result) > > Hrm, this is resulting in: > > Warning: Supp

Re: [PHP] MySQL query results

2002-03-22 Thread Chris
On 22 Mar 2002 at 16:41, Ashley M. Kirchner wrote: > Rick Emery wrote: > The query does get executed, and the record does get changed. > > The code looks like this: > > $conn = @MYSQL_CONNECT($host,$user,$password) ; > mysql_select_db($database, $conn); > $query = "UPDATE clients

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
After a bit of research: -- Rick Emery wrote: > $result = mysql_query(.)' > mysql_num_rows($result) Hrm, this is resulting in: Warning: Supplied argument is not a valid MySQL result resource in ./index.php on line 16 Rows -- Rightfully so. mysql_qu

Re: [PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
Rick Emery wrote: > $result = mysql_query(.)' > mysql_num_rows($result) Hrm, this is resulting in: Warning: Supplied argument is not a valid MySQL result resource in ./index.php on line 16 Rows The query does get executed, and the record does get changed. The code looks like

RE: [PHP] MySQL query results

2002-03-22 Thread Rick Emery
$result = mysql_query(.)' mysql_num_rows($result) -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 5:28 PM To: PHP-General List Subject: [PHP] MySQL query results How can I tell whether anything was matched and changed af

[PHP] MySQL query results

2002-03-22 Thread Ashley M. Kirchner
How can I tell whether anything was matched and changed after a mysql_db_query? If I'm in MySQL's console and I perform a query, it comes back and tells me something like: Query OK, 0 rows affected (0.00 sec) Rows matched: 0 Changed: 0 Warnings: 0 And if something matched, 'Rows