glenelkins Posted October 10, 2006 Share Posted October 10, 2006 hianyone spot the problem with this qery?? it errors out on the second create table, but if i do them indiviually it works fine![code]CREATE TABLE tags (id int not null primary key auto_increment,name varchar(50));CREATE TABLE tag_values (id int not null primary key auto_increment,value text);CREATE TABLE tag_values_int (tag_id int,value_id int);[/code] Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 10, 2006 Share Posted October 10, 2006 are you trying to call that all at once with mysql_query()? if so, that's your problem, not the syntax of the query. notice this quote from the mysql_query() manual page:[quote]The query string should not end with a semicolon[/quote]you need to run queries [i]separately[/i] through PHP for mysql. Quote Link to comment Share on other sites More sharing options...
glenelkins Posted October 10, 2006 Author Share Posted October 10, 2006 well iv seen alot of setup scripts with all the queries like this in one file! Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 10, 2006 Share Posted October 10, 2006 [quote author=glenelkins link=topic=111071.msg449841#msg449841 date=1160489431]well iv seen alot of setup scripts with all the queries like this in one file![/quote]setup scripts will typically have the queries set up like that, and then parse them and run them one at a time. it's a completely different thing to have a single SQL file with all your queries in it and running them all as one single query. look at the install script for any major forum, and you'll see exactly what i'm talking about. Quote Link to comment Share on other sites More sharing options...
glenelkins Posted October 10, 2006 Author Share Posted October 10, 2006 ok thats not a problem, iv never had the need to setup a database through php yet! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.