Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
error in my code- creating a table
Old 08-03-2009, 01:37 PM error in my code- creating a table
Webmaster Talker

Posts: 611
Trades: 0
hi, im creating a "food" table and the browser is giving me an error when i run it, any help greatly appreciated. thank you. note that i put private, user, and pass, where my private info went. derek

here is the code

Code:
<?php

 // Make a MySQL Connection

  mysql_connect("private", "user", "pass") or die(mysql_error());

  mysql_select_db("derek_test3") or die(mysql_error());

 

  // Create a MySQL table in the selected database

  mysql_query("CREATE TABLE food(

 id INT NOT NULL AUTO_INCREMENT,

  PRIMARY KEY(id),

  position VARCHAR(30),

  meal VARCHAR(30)")

  or die(mysql_error());
 

  echo "Table Created!";

 

  ?>
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-04-2009, 12:05 PM Re: error in my code- creating a table
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
there is missing ) at the end of the query
shouldn't be like this
PHP Code:
mysql_query("CREATE TABLE food(

 id INT NOT NULL AUTO_INCREMENT,

  PRIMARY KEY(id),

  position VARCHAR(30),

  meal VARCHAR(30))"
); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 08-04-2009, 12:14 PM Re: error in my code- creating a table
Webmaster Talker

Posts: 611
Trades: 0
THANK YOU SO MUCH JOHN!!! IVE BEEN WAITING 2 DAYS FOR THAT lol. so thank you very much . derek
silverglade is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to error in my code- creating a table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17619 seconds with 12 queries