odetron Posted July 5, 2007 Share Posted July 5, 2007 So im getting an error saying one of my tables doesn't exist. So I re-run my table makeing script and its not working <?php $dbhost = 'xxxxxxx'; $dbuser = 'xxxxx'; $dbpass = 'xxxxxxxx'; $con = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'xxxxxxxxx'; mysql_select_db($dbname, $con); $sql="CREATE TABLE news ( Name VARCHAR(15), Subject VARCHAR(15), Message VARCHAR(1000), Date VARCHAR(10), ID int, )"; mysql_query($sql,$con); ?> whats wrong? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 $sql="CREATE TABLE news ( Name VARCHAR(15), Subject VARCHAR(15), Message VARCHAR(1000), Date VARCHAR(10), ID int, )"; see ID int it has , Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 5, 2007 Share Posted July 5, 2007 Also, VARCHAR has a limit of 255 characters. If you need more, use the type TEXT for the message field Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 ID int, no range value Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.