phemi Posted December 30, 2008 Share Posted December 30, 2008 Hi everyone, please am a newbie in PHP and am trying to create a table in MySQL Database, but everytime i try creating this table i have this Error code : Sorry, Table could not be createdYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHA(30), Surname VARCHA(30), ' at line 4 andd here is the code itself. <?php mysql_connect("localhost","","") or die("<strong> Hello, there is an error connecting to database </strong><br />" . mysql_error()); mysql_query("CREATE DATABASE igs_results") or die("<strong>Sorry, Error connecting to Database</strong>". mysql_error()); mysql_select_db("igs_results"); mysql_query("CREATE TABLE grade2_result( result_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(result_id), Firstname VARCHA(30), Surname VARCHA(30), Age INT )"); die ("Sorry, Table could not be created" . mysql_error()); ?> Please can anyone tell me where am wrong. Thanks so much. Link to comment https://forums.phpfreaks.com/topic/138900-creating-a-mysql-table-problem/ Share on other sites More sharing options...
premiso Posted December 30, 2008 Share Posted December 30, 2008 Varcha to varchar Link to comment https://forums.phpfreaks.com/topic/138900-creating-a-mysql-table-problem/#findComment-726335 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.