note 30986 added to function.odbc-exec
| From: | rupix at rediffmail dot com | Date: | Sat, 05 Apr 2003 13:05:35 +0000 |
| Subject: | note 30986 added to function.odbc-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46254@lists.php.net to get a copy of this message | ||
I tried the following line of code
<?php
$odbc=odbc_connect("pbk", "root","") or die(odbc_errormsg());
$q="insert into pbk values(\"$name\", \"$phone\")";
print $q;
odbc_exec($odbc, $q) or die("<p>".odbc_errormsg());
?>
it does not work. However if I use single quotes instead of \" the thing runs smoothly
thus the following would work
<?php
$odbc=odbc_connect("pbk", "yourworstnightmare","abracadabra") or
die(odbc_errormsg());
$q="insert into pbk values('$name', '$phone')";
print $q;
odbc_exec($odbc, $q) or die("<p>".odbc_errormsg());
?>
Also having a user dsn is no good on win2k. Always have a System DSN. I don't know yet what are
the implications of the same.
--
http://www.php.net/manual/en/function.odbc-exec.php
http://master.php.net/manage/user-notes.php?action=edit+30986
http://master.php.net/manage/user-notes.php?action=delete+30986
http://master.php.net/manage/user-notes.php?action=reject+30986