[PHP-DEV] PHP 4.0 Bug #5648: INSERT statements no longer work using mysql_query() From: alanflum <email protected>
Date: 07/17/00

From: alanflum <email protected>
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.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>