GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Aug-2003, 16:56
Tigress7 Tigress7 is offline
New Member
 
Join Date: Aug 2003
Posts: 2
Tigress7 is an unknown quantity at this point

Can't seem to create db


Help! I'm so stuck. I'm trying to create a table called users in mySQL thru PHP but it doesn't seem to work!

PHP Code:

<html>
<?php

mysql_connect('localhost','username','')or
die ("Couldnt connect to localhost");

   mysql_create_db("my_db12");

mysql_select_db("my_db12");

$query = "create table users (
            username varchar(12) NOT NULL primary key,
            password char(12) NOT NULL,
            firstName char(20) NOT NULL,
            lastName char(20) NOT NULL,
            email char(20) NOT NULL,
        
     )";


mysql_query($query) or die("Cannot Create the User Table!");

?>

</html> 



It comes back with the Cannot create the user table statement.

Any ideas as to why it isn't working?
thanks so much!

Note:I'm using php vers 4.2.3 , is this the prob?
  #2  
Old 18-Aug-2003, 19:47
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Welcome to GIDForums Tigress7.

Is your mySQL unpassworded? If not, your going to have to state the password somewhere for it to work right?

Rob
  #3  
Old 19-Aug-2003, 07:36
Tigress7 Tigress7 is offline
New Member
 
Join Date: Aug 2003
Posts: 2
Tigress7 is an unknown quantity at this point
mysql is unpassworded
  #4  
Old 19-Aug-2003, 09:19
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello Tigress7,

There are quite a few things that could be wrong. Like, is 'username' a valid user in MySQL's database? Have you (the root user) granted 'username' the corect permissions to 'create' a db/table?

It's difficult to troubleshoot if you don't explain your setup in detail.
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Geo-targetting websites to create personalised information for the user jrobbio Advertising & Affiliates Forum 1 06-Jun-2003 08:11
How do you create a crisp,sharp looking icon? rhino1616 Web Design Forum 1 04-Jun-2003 17:19
How do I create JavaScript Links? JdS Web Design Forum 8 29-Jan-2003 15:02
Create a batch file on linux JdS Web Hosting Forum 8 13-Jan-2003 19:59
How to create a scrolling news section... JdS Web Design Forum 7 03-Nov-2002 06:35

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:06.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.