rinteractive Posted January 3, 2008 Share Posted January 3, 2008 i am new to mysql, table is not creating even there is no error message. The code i have used below. <?php $con = mysql_connect("localhost","root",""); if(!$con) { echo"Connection failed".mysql_error(); } mysql_select_db("project",$con); $sql= "CREATE TABLE `experience` ( `id` int(11) unsigned NOT NULL auto_increment, `years` int(11) NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM"; mysql_query($sql,$con); mysql_close($con); ?> Please any one help me Link to comment https://forums.phpfreaks.com/topic/84276-creating-table/ Share on other sites More sharing options...
adam291086 Posted January 3, 2008 Share Posted January 3, 2008 change mysql_query($sql,$con); to mysql_query($sql,$con) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/84276-creating-table/#findComment-429189 Share on other sites More sharing options...
rinteractive Posted January 3, 2008 Author Share Posted January 3, 2008 Thanks Adam my problem is solved now, your code helped me a lot Link to comment https://forums.phpfreaks.com/topic/84276-creating-table/#findComment-429192 Share on other sites More sharing options...
adam291086 Posted January 3, 2008 Share Posted January 3, 2008 you should always include error reports. They help us debug. You can also put error_reporting(E_ALL); at the top of your code. It helps with errors Link to comment https://forums.phpfreaks.com/topic/84276-creating-table/#findComment-429194 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.