This is a discussion on ODBC Problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi I get this error " Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] '' is not a valid name. Make ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi I get this error "
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] '' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long., SQL state 37000 in SQLExecDirect in D:\Apache\Apache2\htdocs\redirect\add.php on line 16 "when i try to run an sql statement. The sql statement is INSERT INTO site (site_name, site_url) values ("google", www.google.com); which I know is correct because in Access if I run that exact statement it works perfectly. The code is as follows: --------------------------- <?php $Site_NAME = $_GET['name']; $Site_URL = $_GET['url']; $conn = odbc_connect('redirect','',''); if($conn <= 0){ echo "Error in connection<BR>"; exit; $Site_URL = "/forum/error.php?err=500"; } else{ $query = "INSERT INTO site (site_name, site_url) values (\"". $Site_NAME . "\", \"" . $Site_URL . "\");"; echo $query; $result = odbc_exec($conn, $query); } include("reload.tpl"); ?> --------------------------- The values are passed to this file from a different file. I know everything else is working because the SQL statement I tested in Access is $query which is echoed out to the screen. Any ideas? Thanks. -- Martin Cunningham. Macro-Tek http://www.macro-tek.cjb.net/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|