MySQL Problem in PHP4 Snapshot 200003211145
| From: | Ben Schumacher | Date: | Tue, 21 Mar 2000 20:50:28 +0000 |
| Subject: | MySQL Problem in PHP4 Snapshot 200003211145 | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12471@lists.php.net to get a copy of this message | ||
Hello-
I recently downloaded the 200003211145 snapshot from va.php.net/~sas/, because I wanted to try out one of the new features support in this version. (Specifically the JPEG image manipulation functions.)
Everything seemed to be working properly, until I tried to using the mysql_query function to perform an INSERT. Here's an example of code that doesn't work:
<?
mysql_connect("localhost", "user", "pass');
mysql_select_db("db");
$res = mysql_query("INSERT INTO tbl (Field) VALUES (1)");
$id = mysql_insert_id();
echo $id;
?>
Assuming I have a database called "db" and a table called "tbl" with 2 fields, one that's an auto_incrementing primary key, I should be able to insert into the table and then get an insert_id back. However, what actually happens is that I get this warning "MySQL: Unable to save result set in http://url/test.php on line 3." And my $id gets assigned a value of 0.
However, even though there is this warning message, and the insert id is returned as 0, the row still gets inserted into the table.
The same code, however, works perfectly on PHP 3.0.14 and PHP 4.0b4pl1.
Any idea why this would be happening?
Thanks for your help,
- Ben Schumacher