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 Quote 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()); Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/84276-creating-table/#findComment-429194 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.