PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old August 23rd, 2002, 01:47 AM
seiya seiya is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: NYC, NY, USA
Posts: 45 seiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to seiya
Help!

Hi, I wrote my code to creat tables but it doesnt work, can you help me and tell me why, or just write hte basic sintax of creating tables...

Here is my code:

<?

include_once("db_info.php");

$connect = mysql_connect("$db_host", "$db_user", "$db_pass")
or die("Could not connect!");

$connect2 = mysql_select_db("$db_name",$connect)
or die("Could not select database!");

mysql_query("CREATE TABLE reviews (
reviewID int(4) NOT NULL auto_increment,
reviewmenut varchar(255) NOT NULL,
review text ,
reviewtitle varchar(250) ,
PRIMARY KEY (reviewID),
KEY contenttitle (reviewtitle)
)
");

mysql_query("CREATE TABLE previews (
previewID int(4) NOT NULL auto_increment,
previewmenut varchar(255) NOT NULL,
preview text ,
previewtitle varchar(250) ,
PRIMARY KEY (previewID),
KEY contenttitle (previewtitle)
)
");

mysql_query("CREATE TABLE articles (
articleID int(4) NOT NULL auto_increment,
articlemenut varchar(255) NOT NULL,
article text ,
articletitle varchar(250) ,
PRIMARY KEY (articleID),
KEY contenttitle (articletitle)
)
");

mysql_query("CREATE TABLE interviews (
iID int(4) NOT NULL auto_increment,
imenut varchar(255) NOT NULL,
i text ,
ititle varchar(250) ,
PRIMARY KEY (iID),
KEY contenttitle (ititle)
)
");

exit;
?>

Also, I tried adding a $query =
before all mysql commands but still, i get no result.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway