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? Link to comment https://forums.phpfreaks.com/topic/58481-table-problems/ 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 , Link to comment https://forums.phpfreaks.com/topic/58481-table-problems/#findComment-290011 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 Link to comment https://forums.phpfreaks.com/topic/58481-table-problems/#findComment-290012 Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 ID int, no range value Link to comment https://forums.phpfreaks.com/topic/58481-table-problems/#findComment-290016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.