Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating table in mysql problem 1

Status
Not open for further replies.

chineerat

Technical User
Oct 12, 2003
42
TT
i hope i am posting this in the correct place.
in the bottom code i am trying to create a database in PHP using SQL
but when i query if it exists
it shows ERROR.
i am using IIS and i am hosting from my local machine.
am i forget something?
thanks a million in advance.

$sql = 'CREATE TABLE MyTable (MyField1 Numeric NOT NULL DEFAULT 0)';

if( @mysql_query($sql)){
echo ('<p> Jokes created </p>');
}
else {
echo ('<p> ERROR </p>');
}
 
It should be ok. Check your DB connection that you create prior to this statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top