PHP 4.0 Bug #5648: INSERT statements no longer work using mysql_query()

From: Date: Tue, 18 Jul 2000 02:20:10 +0000
Subject: PHP 4.0 Bug #5648: INSERT statements no longer work using mysql_query()
Groups: php.dev 
Request: Send a blank email to php-dev+get-24836@lists.php.net to get a copy of this message
From: alanflum@aksi.net Operating system: Debian GNU Linux \"Woody\" Kernel 2.2.17 PHP version: 4.0.1pl2 PHP Bug Type: MySQL related Bug description: INSERT statements no longer work using mysql_query() We recently upgraded to MySQL 3.23.21-beta and php 4.01pl2 (Apache 1.3.12, Debian v.10.8 Debian GNU Linux "Woody"). INSERT statements no longer work using the mysql_query() . The return value is always 0. UPDATE, and SELECT seem to work fine. In addition, INSERT seems to work OK using mysql_db_query() .Others have reported this same exact problem on phpbuilder.com mailing list archive. In addition, all php scripts on the upgraded machine using INSERT and mysql_query experience the same problem (for example phpMyAdmin). Here is some sample code: $user= "demo"; $host= "localhost"; $password= "mypassword"; $database= "mydatabase"; $connection = mysql_connect($host,$user,$password)or die("No Connection"); mysql_select_db($database, $connection)or die("Can't Select Database"); $addrow = "INSERT INTO test VALUES ('$name1', '$name2')"; $result= mysql_query($addrow, $connection) or die("Can't Add Selections to Test Table"); If I remove the die() in the last statement and check the value of $result, it always returns a 0.

« previous php.dev (#24836) next »