Bug #14086 Updated: If you use the result set of a insert query, you get a warning message.
| From: | derick@php.net | Date: | Fri, 16 Nov 2001 18:11:03 +0000 |
| Subject: | Bug #14086 Updated: If you use the result set of a insert query, you get a warning message. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-70674@lists.php.net to get a copy of this message | ||
ID: 14086
Updated by: derick
Reported By: oliver@samera.com.py
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: Linux 2.4
PHP Version: 4.0.4pl1
New Comment:
From the manual: (http://uk.php.net/manual/en/function.mysql-query.php):
mysql_query() returns TRUE (non-zero) or FALSE to indicate whether or not the query succeeded. A
return value of TRUE means that the query was legal and could be executed by the server. It does not
indicate anything about the number of rows affected or returned. It is perfectly possible for a
query to succeed but affect no rows or return no rows.
<snip>
For SELECT statements, mysql_query() returns a new result identifier that you can pass to
mysql_result(). When you are done with the result set, you can free the resources associated with it
by calling mysql_free_result().
Not a bug, but intended behavior >> bogus
Previous Comments:
------------------------------------------------------------------------
[2001-11-16 11:30:05] oliver@samera.com.py
Tested in RedHat 7.1 with official updates.
------------------------------------------------------------------------
[2001-11-16 11:29:01] oliver@samera.com.py
Summary changed
------------------------------------------------------------------------
[2001-11-16 11:25:43] oliver@samera.com.py
If you use the result set of a insert query, you get a warning message.
// connect
// do an insert
$result = mysql_query("insert into table1(col1) values(1)");
// free a result
mysql_free_result($result);
// a warning is generated
Warning: Supplied argument is not a valid MySQL result resource in your_source.php on line
line_number
php-mysql-4.0.4pl1-9
mysql-3.23.36-1
RedHat 7.1
'./configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--enable-shared'
'--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs'
'--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext'
'--with-gd' '--with-jpeg-dir=/usr' '--with-png'
'--with-zlib' '--with-db2' '--with-db3' '--with-gdbm'
'--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-ftp'
'--enable-wddx' '--without-mysql' '--without-oracle'
'--without-oci8' '--with-xml'
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14086&edit=1