Jump to content

[Help] Little issue


darish

Recommended Posts

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 :3


sry 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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.