Bug #5648 Updated: INSERT statements no longer work using mysql_query()
| From: | akujin11 at yahoo dot com | Date: | Sun, 30 Jun 2002 08:37:25 +0000 |
| Subject: | Bug #5648 Updated: INSERT statements no longer work using mysql_query() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12576@lists.php.net to get a copy of this message | ||
ID: 5648
Updated by: akujin11@yahoo.com
Reported By: alanflum@aksi.net
Status: Closed
Bug Type: MySQL related
Operating System: Debian GNU Linux "Woody" Kernel
PHP Version: 4.0.1pl2
New Comment:
i have been experianceing the exact same problem. i require the use of
the INSERT SQL command and i cannot seem to get it to work. the command
SEEMS to process correctly, with one error. the data is never added to
the database.
the manual does NOT give the required information, and i need a
solution. if you can not give me what i want, can you direct me to
someone that can?
the Akujin
Previous Comments:
------------------------------------------------------------------------
[2000-08-20 06:18:52] sniper@php.net
Read the manual:
http://www.php.net/manual/function.mysql-query.php
--Jani
------------------------------------------------------------------------
[2000-07-17 22:20:10] alanflum@aksi.net
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=5648&edit=1