I can just alter table to rename the fields right? -----Original Message----- From: Patrick Sherrill [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 5:27 AM To: Brian Duke; [EMAIL PROTECTED] Subject: Re: Field Name whitespace via MyODBC
Brian, I think you are going to need to rename your fields/columns. If you are unable to rename them in mysql then you will probably need to rename them in your jet database with Access and re-import them. Your column names should be literals not wrapped in graves or quotes and should contain no whitespace. Whitespace is frequently used as a delimiter. I also avoid any characters other than alphanumeric and the occasional underscore character in field/column names . It helps avoid OS idiosyncrasies and simplifies naming conventions. I hope this helps. Pat... [EMAIL PROTECTED] CocoNet Corporation SW Florida's First ISP 825 SE 47th Terrace Cape Coral, FL 33904 ----- Original Message ----- From: "Brian Duke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 11, 2003 2:50 AM Subject: Field Name whitespace via MyODBC > 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] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]