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.

PHP Forum


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



Freelance Jobs

Reply
problem creating tables...in mysql
Old 06-12-2008, 02:40 PM problem creating tables...in mysql
Skilled Talker

Posts: 77
Name: adam
Location: UK
Trades: 0
PHP Code:
<?php
//Build Database
include('../dbconnect.php');
//Members Table
mysql_query("CREATE TABLE members(
 memberID INT NOT NULL,
 username VARCHAR(30), 
 PRIMARY KEY(username),
 email VARCHAR(30),
 password VARCHAR(30),
 clan BOOL,
 gender BOOL,
 age INT
 )"
)
//Error if table does not get created
or die(mysql_error());  
echo 
"Members Table Created!";
//News Table
mysql_query("CREATE TABLE news(
 newsID INT NOT NULL,
 PRIMARY KEY(newsID),
 title_news VARCHAR(30)'
 body_news VARCHAR(30),
 author_news VARCHAR(30),
 date_news INT
 )"
)
//Error if table does not get created
or die(mysql_error()); 
echo 
"News Table Created!";
 
?>
there is my database creation code however in the browser it comes up with error message..

Members Table Created! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' body_news VARCHAR(30), author_news VARCHAR(30), date_news INT )' at line 4
any ideas plz...
mintuz is offline
Reply With Quote
View Public Profile Visit mintuz's homepage!
 
 
Register now for full access!
Old 06-12-2008, 02:41 PM Re: problem creating tables...in mysql
PeachyJuice's Avatar
Super Talker

Posts: 116
Name: Michele T.
Location: Ny, Ny
Trades: 1
Change:
Code:
title_news VARCHAR(30)'
to
PHP Code:
title_news VARCHAR(30), 
You had a ' instead of a ,
__________________
Freelance web+graphic designer and PHP developer.

Please login or register to view this content. Registration is FREE
PeachyJuice is offline
Reply With Quote
View Public Profile
 
Old 06-12-2008, 02:47 PM Re: problem creating tables...in mysql
Skilled Talker

Posts: 77
Name: adam
Location: UK
Trades: 0
omg thankyou so much
mintuz is offline
Reply With Quote
View Public Profile Visit mintuz's homepage!
 
Old 06-14-2008, 08:30 AM Re: problem creating tables...in mysql
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
take care... you must have privileges... maybe now you have but, if you change the database or user or [..else..] you can have problems. It's recommended to not create tables from scripts only if it's necessary... [there are security reasons too]
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Reply     « Reply to problem creating tables...in mysql
 

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.28343 seconds with 12 queries