darish Posted April 27, 2015 Share Posted April 27, 2015 Well, my website is not reading the "config.php" page , so its not going to "data base" :/ can someone help me out , why is not ? its probably a easy thing to correct to someone who knows :3sry about my english, and I hope I posted this in the right place. config page only have this <?php @session_start(); $connectdb=mysql_connect("localhost","7milimetros","Chetan123"); $usedb=mysql_select_db("7milimetros",$connectdb); $_SESSION['token']=session_id(); ?> Is something wrong here? the data base is called "7milimetros" ... Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/ Share on other sites More sharing options...
Ch0cu3r Posted April 27, 2015 Share Posted April 27, 2015 Code for config.php looks ok to me. However you should add error checking to your code to know why the database connection is failing. <?php @session_start(); $connectdb=mysql_connect("localhost","7milimetros","Chetan123") or trigger_error('Unable to connect to mysql: ' . mysql_error(), E_USER_WARNING); $usedb=mysql_select_db("7milimetros",$connectdb) or trigger_error('Unable to select databae: ' . mysql_error(), E_USER_WARNING); $_SESSION['token']=session_id(); ?> This will either force an error message to be shown or it will be logged in your servers error logs. Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510071 Share on other sites More sharing options...
darish Posted April 27, 2015 Author Share Posted April 27, 2015 whats does "chetan123" ? :S Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510072 Share on other sites More sharing options...
darish Posted April 27, 2015 Author Share Posted April 27, 2015 error in the normal page : http://prntscr.com/6yp0ja error in the code: http://prntscr.com/6yp0ou Thats why I said it was on database, but if its not , is there something wrong? :S Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510073 Share on other sites More sharing options...
Ch0cu3r Posted April 27, 2015 Share Posted April 27, 2015 Those links do not work. Attach screenshots to your post. whats does "chetan123" ? :S That is your database password. Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510075 Share on other sites More sharing options...
darish Posted April 28, 2015 Author Share Posted April 28, 2015 Already fix it ^^ , thank you, dont know how to close thread :S Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510159 Share on other sites More sharing options...
Ch0cu3r Posted April 28, 2015 Share Posted April 28, 2015 You can close a thread but you can mark it as solved by clicking the Best Answer button. Link to comment https://forums.phpfreaks.com/topic/295895-help-little-issue/#findComment-1510170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.