...

View Full Version : MySQL error !!!



ACJavascript
01-01-2004, 06:45 AM
Hello All,

Okay I have this MYSQL code, but FOR some REASON ITS NOT WORKING!

This is the code,, what is wrong???
---------
<?php


//Making mysql connection
include("mysql_connect.php");

//Creating the table for member control

$query="CREATE TABLE members (user_id MEDIUMINT(5) NOT NULL AUTO_INCREMENT);";

//Making mysql query
$result = @mysql_query($query);

if($result){
echo("The MySQL Table 'members' has been created. You may now populate it!");
exit;
}else{
echo("MySQL has a problem");
exit;
}

?>
----------------------

The mysql_connection.php script makes the connection to the database. This works, since it was tested. and it makes the connection. Every time I try to make the table members with the user_id in it, it keeps showing MySQL has a problem.

Please any help is greatly appreciated!!!

Nightfire
01-01-2004, 03:41 PM
Below this line:

echo("MySQL has a problem");

add

echo mysql_error();

Also, on this line

$query="CREATE TABLE members (user_id MEDIUMINT(5) NOT NULL AUTO_INCREMENT);";

Try taking the first ; off

ACJavascript
01-01-2004, 04:32 PM
hey Nightfire,

It is now working! :D

It was the ;

Thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum