Current location: Hot Scripts Forums » Programming Languages » PHP » Create table


Create table

Reply
  #1 (permalink)  
Old 10-24-09, 06:26 AM
zenix zenix is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
Exclamation Create table

Hi, hopefully this is the right forum. I have been using php my admin to create a database. I had it generate code which I copied and pasted into my editor. I finished the coding and loaded it into my browser and I keep getting this parse error that makes no sense to me. if someone could lend e some guidance I'd REALLY appreciate it. I am very new to programming. Here is the code.

Code:
$cZone = "CREATE TABLE zip.zone 
(
zoneID INT(10) UNSIGNED NOT NULL, 
startZip CHAR(3) NOT NULL, 
PRIMARY KEY (zoneID, startZip))"; //This is where the parse error shows up. 
//If I push the last ) and " and ; to the next line down the parse error changes
// to the next line. I can't make sense of this.

?>
<br />
<?php
if($cZone)
{echo "Zone db created";}

$cZip = "CREATE TABLE zip.zip 
(
zoneID INT(10) UNSIGNED NOT NULL, 
startZip CHAR(3) NOT NULL, 
PRIMARY KEY (zoneID, startZip)
)";

Last edited by zenix; 10-24-09 at 06:56 AM.
Reply With Quote
  #2 (permalink)  
Old 10-24-09, 10:36 AM
zenix zenix is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
No ideas? Maybe it doesn't make sense to anyone else I guess. I really wish I could get this database up and running. I'll try a couple of other things...although it's pretty well limited what all I could try I think. Kinda straight forward to make a database. I appreciate all for at least viewing my issue.
Reply With Quote
  #3 (permalink)  
Old 10-24-09, 12:09 PM
zenix zenix is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
Nevermind, i got it. Thanks anyway!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Error Nikas Database 4 05-15-08 10:48 AM
MYSQL database countll Database 2 06-19-07 04:20 PM
What do you think of my database structure? Oskare100 Database 5 12-27-06 07:43 AM
Create two mysql table zoliky Database 4 07-19-06 03:41 PM
Newbie MySQL fccolon PHP 2 03-16-04 10:54 AM


All times are GMT -5. The time now is 08:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.