SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Nov 28, 2008, 07:27 #1
- Join Date
- Apr 2008
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
will not create more than 2 tables via PHP script, but does on PHPmyAdmin.
I have a query will run more than 1 statement at a time.
My SQL isbe:
CREATE TABLE `homepage` ( `content1` longtext, `content2` longtext, `content3` longtext, `title` varchar(100) default NULL, `style` varchar(10) default NULL, `use_homepage_control` char(1) default NULL, `s4` tinyint(4) default NULL, `s5` tinyint(4) NOT NULL default '0', PRIMARY KEY (`s5`) ) TYPE=MyISAM; CREATE TABLE `homepage_style` ( `style_id` tinyint(4) NOT NULL auto_increment, `style_name` char(10) default NULL, `style_description` char(250) default NULL, `s1` tinyint(4) default NULL, `s2` tinyint(4) default NULL, `s3` tinyint(4) default NULL, PRIMARY KEY (`style_id`) ) TYPE=MyISAM;
However this does not work when I use my PHP script to run the query. If I just have one create table then it works.
However when I run the complete SQL through PHPmyAdmin it works and generates both tables.
Any ideas?
-
Nov 28, 2008, 08:28 #2
- Join Date
- Feb 2004
- Location
- Tampa, FL (US)
- Posts
- 9,854
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by http://us2.php.net/manual/en/function.mysql-query.php
Check out our new Industry News forum!
Keep up-to-date with the latest SP news in the Community Crier
I edit the SitePoint Podcast
-
Nov 28, 2008, 09:27 #3
- Join Date
- Apr 2008
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is there any other way to do it?
-
Nov 28, 2008, 09:44 #4
- Join Date
- Feb 2004
- Location
- Tampa, FL (US)
- Posts
- 9,854
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
run mysql_query() twice?
Check out our new Industry News forum!
Keep up-to-date with the latest SP news in the Community Crier
I edit the SitePoint Podcast
-
Nov 28, 2008, 11:21 #5
- Join Date
- Apr 2008
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have a whole database with 2,000 queries to insert a new database.
I've done it by using PHP to break apart the different queries and ran each query separatly.
Thanks for your advice.
-
Nov 30, 2008, 12:40 #6
- Join Date
- Jul 2003
- Location
- Kent
- Posts
- 1,921
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
You have two thousand tables??? Or are you including the records in this set of queries as well?
Dr John
www.kidneydialysis.org.uk
-
Dec 16, 2008, 11:37 #7
- Join Date
- Apr 2008
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This includes the insert statements! There is not 2000 tables!
Bookmarks