Jump to content

[SOLVED] Help: I'm a noob.


clown[NOR]

Recommended Posts

This is my first attempt on working with MySQL... i tried to create a table and add a table to it... but i get this error:

 

Parse error: syntax error, unexpected T_STRING in F:\root\install.php on line 3

 

<?php

CREATE DATABASE `addressbook1` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; // This is line 3
CREATE TABLE contacts(
	ID INT NOT NULL PRIMARY KEY,
	FirstName VARCHAR(20) NOT NULL,
	LastName VARCHAR(20) NOT NULL,
	Address VARCHAR(50) NOT NULL,
	ZipCode INT NOT NULL,
	City VARCHAR(30) NOT NULL, 
	Phone INT NOT NULL,
	CellPhone INT,
	Email VARCHAR(30),
	Website VARCHAR(50)
);

?>

 

can anyone please help me on this one? just for the record... i'm running everything from my computer... incase that has anything to say

Thanks in advance

 

Regards, Clown

Link to comment
Share on other sites

Create the database from whatever database administration tool you installed (phpMyAdmin perhaps?)

 

The general scheme for success at creating a table (or any other query) will be:

 

make database connection

select database

construct SQL query

execute query

 

Reading any of the tutorials here about using a database will be time well spent.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.