RE: [PHP] Re: FOLLOW UP on "column names not liked by odbc/php/access"
mweb, I suggest you use the ODBC Metadata functions in PHP to describe your database, e.g. odbc_tables, odbc_columns, odbc_primarykeys, odbc_foreignkeys, etc. 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: Wednesday, December 05, 2001 6:44 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP] Re: FOLLOW UP on "column names not liked by > odbc/php/access" > > > On Wednesday 05 December 2001 12:21, Dr. Michael Wittmann wrote: > > > - you dont need apostrophes for numeric fields. you get the table > > definition using sql command 'DESC tablename' > > Thanks to Michael and all the others who pointed out my errors. The query > works now. The real problem however, which is REALLY slowing me down, > is that in this project I have to live with php+odbc+MS access, all on a > remote server. I know the DESC instruction above, but access won't take it > via odbc. It gave me this error: > > Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL > statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or > 'UPDATE'., > SQL state 37000 in > SQLExecDirect in C/ etcetera.. > > This is the reason for all my questions in these days: is there really so > little knowledge/documentation on how to handle this particular > combination? > If it were all mysql+apache+php I would perfectly manage > everything by myself. > I have also posted to comp.databases.ms.access without luck so far. > > Again, any pointer to such resources is appreciated. In the > meantime, let me > thank you all once more for your quick and kind suggestions. > > regards, > 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] > > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: FOLLOW UP on "column names not liked by odbc/php/access"
On Wednesday 05 December 2001 12:21, Dr. Michael Wittmann wrote: > - you dont need apostrophes for numeric fields. you get the table > definition using sql command 'DESC tablename' Thanks to Michael and all the others who pointed out my errors. The query works now. The real problem however, which is REALLY slowing me down, is that in this project I have to live with php+odbc+MS access, all on a remote server. I know the DESC instruction above, but access won't take it via odbc. It gave me this error: Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'., SQL state 37000 in SQLExecDirect in C/ etcetera.. This is the reason for all my questions in these days: is there really so little knowledge/documentation on how to handle this particular combination? If it were all mysql+apache+php I would perfectly manage everything by myself. I have also posted to comp.databases.ms.access without luck so far. Again, any pointer to such resources is appreciated. In the meantime, let me thank you all once more for your quick and kind suggestions. regards, mweb - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: FOLLOW UP on "column names not liked by odbc/php/access"
hi, in your sql command there are several errors: it has the form INSERT INTO () VALUES (); but: - there are more items in the list of values than in the list of fieldnames. these lists should match. - there's an extra comma after fieldname 'unico', and the closing ) is missing. - you dont need apostrophes for numeric fields. you get the table definition using sql command 'DESC tablename' (- and the tablename -was- missing :) hope this helps, michael "database,sql,query,table" mweb wrote: > > Hello, > > On the same database, this query works: > > $SQL_Exec_String = "INSERT INTO Multimedia (Titolo,Descrizione,Logo,Link) > VALUES ('prova titolo','prova descrizione','.gif','prova link');"; > $cur= odbc_exec( $cnx, $SQL_Exec_String ); > > This one gives this error: > ISQL_exec_String = "Insert Into (Artista, Opera, Label, Anno, Nazione, CDNow, > Autore, AutoreNome, Genere, GenereCustom, SulWeb, Autorizzato, Unico, VALUES > ('prova2', 'inedita', 'ignota', > '2001','IT', 'nonesiste', 'io', 'lui','3', 'ulteriori dettagli sul genere > musicale', 'http://www.no.it', '1', '20011205111456', 'asdas erfver', 'ciao > ni', '2.5', 'Non andare a capo!');" > > Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in > INSERT INTO statement., SQL state 37000 in SQLExecDirect in > C:\domini\m.net\inserzione3.php on line 115 > Error in odbc_exec( no cursor returned ) > > Does the second qyury look syntactically wrong to you? May it be that some > column name or quoting is wrong, or some value I try insert is not matching > the column type? If so, why would this be a *syntax* error? > > Is it possible to query access via Php so that it will tell the internal > strucure of the table? > (this database was developed and left online by somebody else, that's why > I don't have all this info) > > Any help is greatly appreciated, as are working sql statements for similar > (php+odbc+access) cases. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Partial answer to "FOLLOW UP on "column names not liked by odbc/php/access"
OOPS... of couse the query below doesn't work, it doesn't have the table name (see below however) > ISQL_exec_String = "Insert Into (Artista, Opera, Label, Anno, Nazione, > CDNow, Autore, AutoreNome, Genere, GenereCustom, SulWeb, Autorizzato, > Unico, VALUES ('prova2', 'inedita', 'ignota', > '2001','IT', 'nonesiste', 'io', 'lui','3', 'ulteriori dettagli sul genere > musicale', 'http://www.no.it', '1', '20011205111456', 'asdas erfver', 'ciao > ni', '2.5', 'Non andare a capo!');" > > > Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error > in INSERT INTO statement., SQL state 37000 in SQLExecDirect in > C:\domini\m.net\inserzione3.php on line 115 > Error in odbc_exec( no cursor returned ) Adding the table name, I "simply" get: Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in C:\domini\m.net\inserzione3.php on line 116 Error in odbc_exec( no cursor returned ) This is clear, but, since I just take over the database, no docs exists about it, and I only have Linux running right now at home, how do I fins out quickly which columns are type mismatch? the 2.5 value almost sure doesn't go into quotes, right? but what about the others? TIA, Mweb - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [PHP] FOLLOW UP on "column names not liked by odbc/php/access"
Just a thought. 'Label' might be a reserved name on win as it is/was used to describe the name of a volume (drive). But then again, maybe not. George - Original Message - From: "mweb" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, December 05, 2001 10:45 AM Subject: [PHP] FOLLOW UP on "column names not liked by odbc/php/access" > Hello, > > On the same database, this query works: > > $SQL_Exec_String = "INSERT INTO Multimedia (Titolo,Descrizione,Logo,Link) > VALUES ('prova titolo','prova descrizione','.gif','prova link');"; > $cur= odbc_exec( $cnx, $SQL_Exec_String ); > > This one gives this error: > ISQL_exec_String = "Insert Into (Artista, Opera, Label, Anno, Nazione, CDNow, > Autore, AutoreNome, Genere, GenereCustom, SulWeb, Autorizzato, Unico, VALUES > ('prova2', 'inedita', 'ignota', > '2001','IT', 'nonesiste', 'io', 'lui','3', 'ulteriori dettagli sul genere > musicale', 'http://www.no.it', '1', '20011205111456', 'asdas erfver', 'ciao > ni', '2.5', 'Non andare a capo!');" > > > Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in > INSERT INTO statement., SQL state 37000 in SQLExecDirect in > C:\domini\m.net\inserzione3.php on line 115 > Error in odbc_exec( no cursor returned ) > > Does the second qyury look syntactically wrong to you? May it be that some > column name or quoting is wrong, or some value I try insert is not matching > the column type? If so, why would this be a *syntax* error? > > Is it possible to query access via Php so that it will tell the internal > strucure of the table? > (this database was developed and left online by somebody else, that's why > I don't have all this info) > > Any help is greatly appreciated, as are working sql statements for similar > (php+odbc+access) cases. > > regards, > 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] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
FOLLOW UP on "column names not liked by odbc/php/access"
Hello, On the same database, this query works: $SQL_Exec_String = "INSERT INTO Multimedia (Titolo,Descrizione,Logo,Link) VALUES ('prova titolo','prova descrizione','.gif','prova link');"; $cur= odbc_exec( $cnx, $SQL_Exec_String ); This one gives this error: ISQL_exec_String = "Insert Into (Artista, Opera, Label, Anno, Nazione, CDNow, Autore, AutoreNome, Genere, GenereCustom, SulWeb, Autorizzato, Unico, VALUES ('prova2', 'inedita', 'ignota', '2001','IT', 'nonesiste', 'io', 'lui','3', 'ulteriori dettagli sul genere musicale', 'http://www.no.it', '1', '20011205111456', 'asdas erfver', 'ciao ni', '2.5', 'Non andare a capo!');" Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:\domini\m.net\inserzione3.php on line 115 Error in odbc_exec( no cursor returned ) Does the second qyury look syntactically wrong to you? May it be that some column name or quoting is wrong, or some value I try insert is not matching the column type? If so, why would this be a *syntax* error? Is it possible to query access via Php so that it will tell the internal strucure of the table? (this database was developed and left online by somebody else, that's why I don't have all this info) Any help is greatly appreciated, as are working sql statements for similar (php+odbc+access) cases. regards, mweb - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php