Weird issue
Posted: Tue Dec 02, 2008 11:38 am
Hi there, i'm new to this forum and to the PHP scene aswell, i'm having an strange issue with my php code, all it does is throw a blank page and i've been trying to solve this for like 2 days now, i think it should be pretty easy for someone that codes in PHP everyday but it seems thats its too much for me haha
Well, thanks in advance for any advice i could get through this forum, and have a happy day you all
<?
ini_set('display_errors', 1);
$access=1;
$host="localhost"; // Host name
$username="a"; // Mysql username
$password="123456"; // Mysql password
$db_name=$_SESSION['db']; // Database name
$tblusers="users_master"; // Table name
mysql_connect("$host", "$username", "$password") or die("Cannot connect");
mysql_select_db("$db_name") or die("cannot select DB");
$sqluser="SELECT * FROM $tblusers WHERE login='".$_SESSION['login']."'";
$ruser=mysql_query($sqluser);
$numrows=mysql_num_rows($ruser);
if ($numrows==0)
{
echo "Error, usuario no encontrado, comuniquese con el administrador del sistema";
access=0;
} else {
while($info = mysql_fetch_array($ruser))
{
$_SESSION['USER']=$info['userid'];
}
}
?>
Well, thanks in advance for any advice i could get through this forum, and have a happy day you all
<?
ini_set('display_errors', 1);
$access=1;
$host="localhost"; // Host name
$username="a"; // Mysql username
$password="123456"; // Mysql password
$db_name=$_SESSION['db']; // Database name
$tblusers="users_master"; // Table name
mysql_connect("$host", "$username", "$password") or die("Cannot connect");
mysql_select_db("$db_name") or die("cannot select DB");
$sqluser="SELECT * FROM $tblusers WHERE login='".$_SESSION['login']."'";
$ruser=mysql_query($sqluser);
$numrows=mysql_num_rows($ruser);
if ($numrows==0)
{
echo "Error, usuario no encontrado, comuniquese con el administrador del sistema";
access=0;
} else {
while($info = mysql_fetch_array($ruser))
{
$_SESSION['USER']=$info['userid'];
}
}
?>