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
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
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
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
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
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
[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
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.
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
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
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
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
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
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
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.
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
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
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
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
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
$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
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
22 matches
Mail list logo