On the windows machine I have Acess2003. I installed the MyODBC to push the
data into the FreeBSD MySQL server. The connection worked like a dream.
Kudos to the MyODBC team. 

The table that the connection created included field names that have spaces
in the name. I'm trying to access the data thru my PHP scripts. I tried
this:

$sql7 = "SELECT LERG_7_SHA.LATA ,LERG_7_SHA.SWITCH , `LERG_7_SHA.SHA
INDICATOR` , `LERG_7_SHA.H ORG B TDM` FROM LERG_7_SHA WHERE (
LERG_7_SHA.SWITCH = \"$npa\" AND `LERG_7_SHA.SHA INDICATOR` = \"$nxx\" )
LIMIT 0, 30";

And 

$sql7 = "SELECT LERG_7_SHA.LATA ,LERG_7_SHA.SWITCH ,
\'LERG_7_SHA.SHA INDICATOR\' , \'LERG_7_SHA.H ORG B TDM\' ,\'LERG_7_SHA.H
ORG C TDM\' , LERG_7_SHA.HOST , LERG_7_SHA.OCN , LERG_7_SHA.AOCN FROM
LERG_7_SHA WHERE (LERG_7_SHA.SWITCH = \"$npa\" AND
\'LERG_7_SHA.SHA_INDICATOR\' = \"$nxx\" ) LIMIT 0, 30";

Both do not work. The query breaks down where the backticks are or tries to
add the literal string of 'LERG_7_SHA.SHA INDICATOR' in the result data. I
have tried with single quotes and double quotes. I can issue this command on
the mysql command line and it does work. Can someone help me syntax this
line correct? The script.php and the database are on the same FreeBSD
machine.     


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to