It gets connected, but its something wrong with the query. This should work with MySQL which I'm getting used to so I can't really find whats wrong.
Heres the error I get:
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in CREATE TABLE statement., SQL state 37000 in SQLExecDirect in W:\www\odbc\odbc.php on line 16
Ok it says odbc connected, so it connected OK.
If I run this query: SELECT * FROM nothing
it will say 'nothing' doesnt exist. So this kinda works OK. But the above query doesnt seem to work for some reason.
Basicly all I need to do is setup a table.
With MySQL thats pretty simple by using that above code, or by using the commandline. But for ODBC I didnt find any commandline so I cant see which tables are already there.. neither do I know how to create ones.
Ok, now I solved that, and couldnt edit my above post and neither do I want to start a new so here's my further problems:
The syntax for ODBC are a little different from MySQL I think, atleast the one for creating a table, so hope anyone can give me a helping hand here.
This works, but only create a column called output in the table temp:
$sql = "CREATE TABLE temp (output VARCHAR(255) NOT NULL);";
But this doesnt assign each new I add there a uniqe ID, which increases.
For that I use the below code in MySQL but this doesnt work with ODBC. Hope anyone can help me debug/fix this code:
$sql = "CREATE TABLE temp (output VARCHAR(255) NOT NULL), id INT(6) NOT NULL AUTO_INCREMENT), PRIMARY KEY (id));";
^Its supposed to create 1 table and 2 fields.
The table is named 'temp'
First field is named 'output' and can be 255 chars long.
Second field is 'id', which is supposed to increase every time I add one, and increase itself by one. Therefore the AUTO_INCREMENT.
Thanks for all help.. greatly apprecciated!!!