Bug #10484 Updated: Problem with insert in ODBC
| From: | cynic@php.net | Date: | Thu, 26 Apr 2001 04:06:19 +0000 |
| Subject: | Bug #10484 Updated: Problem with insert in ODBC | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52458@lists.php.net to get a copy of this message | ||
ID: 10484
Updated by: cynic
Reported By: Domlane@hotmail.com
Old-Status: Open
Status: Bogus
Bug Type: ODBC related
PHP Version: 4.0.4pl1
Assigned To:
Comments:
Previous Comments:
---------------------------------------------------------------------------
[2001-04-25 11:32:16] Domlane@hotmail.com
$BD = odbc_connect ('BdTest', SQL_CUR_USE_DRIVER);
should be read like $BD = odbc_connect ('BdTest', '', '',
SQL_CUR_USE_DRIVER);
but still not working..
---------------------------------------------------------------------------
[2001-04-25 10:36:32] kalowsky@php.net
you're correct insert statement is fine, needed more wake up time on that.
your odbc_connect is wrong. you need to provide 3 or 4 parameters, not just two. as per the
description found at:
http://www.php.net/manual/en/function.odbc-connect.php
---------------------------------------------------------------------------
[2001-04-25 10:17:50] Domlane@hotmail.com
Yes it is correct!
As there only are two fields in my table and that I try to fill them all, I can work it this way
I could have use "INSERT INTO test (field1, field2) VALUES ('a', 'b')"
"INSERT INTO test VALUES ('a', 'b')" work the same way
---------------------------------------------------------------------------
[2001-04-25 10:08:26] kalowsky@php.net
unless I'm missing something your INSERT statement is not correct.
---------------------------------------------------------------------------
[2001-04-25 00:27:18] Domlane@hotmail.com
$BD = odbc_connect ('BdTest', SQL_CUR_USE_DRIVER);
$SQL = "insert into test values ('a', 'b')";
$TabUser = odbc_exec($BD, $SQL);
this don't work...nothing had been added in the table test
$BD = odbc_connect ('BdTest '', SQL_CUR_USE_DRIVER);
$SQL = "select * from Utilisateur where Nom_utilisateur = '$Nom' and Mot_de_passe =
'$Pass'";
$TabUser = odbc_exec($BD, $SQL);
This work fine!
How should i use "insert" statement in order to make it works??
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10484&edit=2