ODBC Problem

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-14-2003
Martin Cunningham
 
Posts: n/a
Default ODBC Problem

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/



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0