Hi all, i need your help i spent 2 hours to find the problem and didnt see, i try to insert into my table
$query="INSERT INTO `voute` (`numboite`, `numclient`, `nummandat`, `type`, `nomclient`, `mandat`, `annee`)
VALUES ('".$_POST['numboite']."', '".$_POST['numclient']."', '".$_POST['nummandat']."', '".$_POST['type']."', '".$_POST['nomclient']."', '".$_POST['mandat']."', '".$_POST['annee']."')";
And i obtain a error
I use IIS with PHP5
Problem with INSERT INTO
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Problem with INSERT INTO
Really, an error?fraz wrote:Hi all, i need your help i spent 2 hours to find the problem and didnt see, i try to insert into my table
$query="INSERT INTO `voute` (`numboite`, `numclient`, `nummandat`, `type`, `nomclient`, `mandat`, `annee`)
VALUES ('".$_POST['numboite']."', '".$_POST['numclient']."', '".$_POST['nummandat']."', '".$_POST['type']."', '".$_POST['nomclient']."', '".$_POST['mandat']."', '".$_POST['annee']."')";
And i obtain a error
I use IIS with PHP5
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Problem with INSERT INTO
Agreed, i don't see a problem with the SQL you posted. Why not post the error rather than saying you just have an error?
-
Bryan.5050
- Forum Newbie
- Posts: 1
- Joined: Wed Dec 02, 2009 6:10 pm
Re: Problem with INSERT INTO
Just a try but I don't put single quotes around the table field names. Try using this:
I am assuming the data types are all text because you are using single quotes around your POST variables.
Code: Select all
$query = "INSERT INTO voute(numboite, numclient, nummandat, type, nomclient, mandat, annee)
VALUES(
'".$_POST["numboite']."',
.
.
.
)";