RE: [PHP] Column name not liked by PHP/ODBC and Access
Don't know if you've tried it, but typically, you put square brackets '[]' around a table or field name that ODBC doesn't like. (i.e.: it has a space in it, it has a name which is a reserved word in SQL, etc...) - Theo -Original Message- From: Jim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 5:53 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Column name not liked by PHP/ODBC and Access You could just rename the column in the db. Putting quotes around Note is not the solution because the quotes are causing the invalid name error. I don't see that Note is a reserved word anywhere. Access is quite picky about what data you send it. For instance, if a field is set to require some input, then it will error out if you don't supply any. Jim On Tuesday 04 December 2001 23:25, Jim wrote: I've searched high and low for _good_ PHP/MSACCESS info, but the fact is not that many people use it. I know. It's not my choice, believe me.. :-(( What I've found very helpful is to use MS ACCESS' SQL builder to test out my queries. Fairly reliably, if it works there, it'll work in PHP. Fine, but I guess it won't run on my Linux PC, will it? I'll search the web for examples of its usage, anyway. Any pointer is appreciated. Thanks, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Column name not liked by PHP/ODBC and Access
mweb, Just a guess - is Note a reserved word? you might want to quote/escape it. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: mweb [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 4:53 PM To: [EMAIL PROTECTED] Subject: [PHP] Column name not liked by PHP/ODBC and Access Hello, still fighting to drive MS access from PHP, I have come into an error when I feed odbc_exec with this statement (db connection is fine now): INSERT INTO Redazione (ID, Name, Nickname, Username, password, From, Note, amministratore, playlist, email, role, web) VALUES (NULL , me, webmin, webber, 12321, 0, , on, on, e2e2e, 222e, www.test.com); Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:\domini\m.net\cng_red.php on line 71 Error(no cursor odbc_exec) The weird thing is that I this syntax error ONLY if I write Note in the columns list. If I omit it, or even change to not existing column name (like note_fake for example, no errors are reported. If I omit it I get just complaints that there are not enough fields, but no errors. Also, it couldn't care less what I put as the Note field value ( in the case above). Ideas? Mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Column name not liked by PHP/ODBC and Access
On Tuesday 04 December 2001 22:47, Andrew Hill wrote: mweb, Just a guess - is Note a reserved word? you might want to quote/escape it. Excellent idea. Actually, putting Note between double quotes gives: INSERT INTO Red (ID, Nome, Nickname, Username, password, pict, Note, admin, playlist, email, ruolo, web) VALUES (NULL , mweb, webfm, webfm1, 12321, 0, , on, on, e2e2e, 222e, www.ni.it); 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 C:\domini\musicboom.net\cng_red.php on line 71 Error(no cursor odbc_exec) How else could I escape Note, and what this last message means? In general do you know about *detailed* tutorial for MS access via odbc? TIA, mweb P.S.: special thanks to Andrew Hill who is always very fast and patient in his answers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Column name not liked by PHP/ODBC and Access
I've searched high and low for _good_ PHP/MSACCESS info, but the fact is not that many people use it. What I've found very helpful is to use MS ACCESS' SQL builder to test out my queries. Fairly reliably, if it works there, it'll work in PHP. Jim On Tuesday 04 December 2001 22:47, Andrew Hill wrote: mweb, Just a guess - is Note a reserved word? you might want to quote/escape it. Excellent idea. Actually, putting Note between double quotes gives: INSERT INTO Red (ID, Nome, Nickname, Username, password, pict, Note, admin, playlist, email, ruolo, web) VALUES (NULL , mweb, webfm, webfm1, 12321, 0, , on, on, e2e2e, 222e, www.ni.it); 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 C:\domini\musicboom.net\cng_red.php on line 71 Error(no cursor odbc_exec) How else could I escape Note, and what this last message means? In general do you know about *detailed* tutorial for MS access via odbc? TIA, mweb P.S.: special thanks to Andrew Hill who is always very fast and patient in his answers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Column name not liked by PHP/ODBC and Access
On Tuesday 04 December 2001 23:25, Jim wrote: I've searched high and low for _good_ PHP/MSACCESS info, but the fact is not that many people use it. I know. It's not my choice, believe me.. :-(( What I've found very helpful is to use MS ACCESS' SQL builder to test out my queries. Fairly reliably, if it works there, it'll work in PHP. Fine, but I guess it won't run on my Linux PC, will it? I'll search the web for examples of its usage, anyway. Any pointer is appreciated. Thanks, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Column name not liked by PHP/ODBC and Access
You could just rename the column in the db. Putting quotes around Note is not the solution because the quotes are causing the invalid name error. I don't see that Note is a reserved word anywhere. Access is quite picky about what data you send it. For instance, if a field is set to require some input, then it will error out if you don't supply any. Jim On Tuesday 04 December 2001 23:25, Jim wrote: I've searched high and low for _good_ PHP/MSACCESS info, but the fact is not that many people use it. I know. It's not my choice, believe me.. :-(( What I've found very helpful is to use MS ACCESS' SQL builder to test out my queries. Fairly reliably, if it works there, it'll work in PHP. Fine, but I guess it won't run on my Linux PC, will it? I'll search the web for examples of its usage, anyway. Any pointer is appreciated. Thanks, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]