asking question

asking question

am 21.09.2011 14:16:34 von valery-christian

--881542242-1999472178-1316607394=:86927
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

the meaning of Warning: mysql_fetch_array(): supplied argument is not a val=
id MySQL result resource in C:\Program Files\EasyPHP 2.0b1\www\memo3\index.=
php on line 64=0A
--881542242-1999472178-1316607394=:86927--

Re: asking question

am 21.09.2011 15:41:23 von Reindl Harald

--------------enig8AD8B8D63D8AC8A0139FC9F0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

your variable is not the result of mysql_query()
empty, contains something else or whatever

Am 21.09.2011 14:16, schrieb valery-christian:
> the meaning of Warning: mysql_fetch_array(): supplied argument is not a=
valid MySQL result resource in C:\Program Files\EasyPHP 2.0b1\www\memo3\=
index.php on line 64
>

--=20

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

http://www.thelounge.net/signature.asc.what.htm



--------------enig8AD8B8D63D8AC8A0139FC9F0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk556YMACgkQhmBjz394AnmOVgCfbgw7Xs3x5MTgGnrvYv81 6+E0
jKAAoIuYm1UnNLAaaN+L9YiIFkusoay8
=Wd5m
-----END PGP SIGNATURE-----

--------------enig8AD8B8D63D8AC8A0139FC9F0--

RE: asking question

am 21.09.2011 16:18:07 von Jerry Schwartz

It is important to call all of the MySQL functions in the right order. It is
very easy to skip one if you are just learning. I'm not going to give you the
exact function calls, because there are several sets. Pick a set (PDO works
with different databases, so it is most portable) and then keep these steps in
mind:

1. Connect to the database server; this returns a resource (handle) for the
database server
2. Select the database, if the first step didn't already do that
3. Execute a query, using the resource from step 1; this will return a value
that you will use in the next step
4a. If the query returned a set of records (a valid SELECT, for example), you
can now use the functions (such as mysql_fetch_array) that fetch the data for
a row
4b. If the query did NOT return a set of records, the query would have
returned a Boolean value to tell you if it worked or not
5. Free up the result set

That's the general sequence. The details will be different for mysql, mysqli,
and PDO.

Your error message means that either you skipped step 1, 2, or 3; or that step
3 didn't return a record set. If could have been something like an INSERT, or
it could have been a SELECT that wasn't valid.

Prepared statements use a more complicated sequence.

I hope that helps.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@gii.co.jp
Web site: www.giiresearch.com


>-----Original Message-----
>From: valery-christian [mailto:valechris2001@yahoo.fr]
>Sent: Wednesday, September 21, 2011 8:17 AM
>To: mysql@lists.mysql.com
>Subject: asking question
>
>the meaning of Warning: mysql_fetch_array(): supplied argument is not a valid
>MySQL result resource in C:\Program Files\EasyPHP 2.0b1\www\memo3\index.php
>on
>line 64




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: asking question

am 21.09.2011 16:25:07 von Jerry Schwartz

I should have mentioned that there is an example for mysql in the
documentation: http://www.php.net/manual/en/mysql.examples-basic.php. It is
the simplest interface, but it is not object-oriented. Mysqli can be used
either as procedures or as objects.

The differences between mysql, mysqli, and PDO are on page
http://www.php.net/manual/en/mysqli.overview.php.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@gii.co.jp
Web site: www.giiresearch.com


>-----Original Message-----
>From: valery-christian [mailto:valechris2001@yahoo.fr]
>Sent: Wednesday, September 21, 2011 8:17 AM
>To: mysql@lists.mysql.com
>Subject: asking question
>
>the meaning of Warning: mysql_fetch_array(): supplied argument is not a valid
>MySQL result resource in C:\Program Files\EasyPHP 2.0b1\www\memo3\index.php
>on
>line 64




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org