View Single Post
  #2 (permalink)  
Old 10-14-2008, 06:39 PM
fulleffect's Avatar
fulleffect fulleffect is offline
WebProWorld Pro
 
Join Date: Jun 2008
Location: Northeast UK
Posts: 107
fulleffect RepRank 1
Default Re: MYSQL DB creation with php and mysql command

The most important piece of code you're missing is......

Quote:
mysql_query($sql) or die(mysql_error());

"or die(mysql_error())"

This will immediately output what the error is (if any).

When i tried your code on my server, it kept giving me a permission error.

I am using Linux, cpanel/whm, which has stricter security on databases and you cant easily create a database from the php/apache environment.

What are you trying to achieve? couldn't you create a table instead, inside of a master database?

Quote:
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)
__________________

Reply With Quote