Weird issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sun2k4
Forum Newbie
Posts: 3
Joined: Tue Dec 02, 2008 11:34 am

Weird issue

Post by sun2k4 »

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'];
}
}
?>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Weird issue

Post by requinix »

Well yeah. You don't tell it to print anything except for an error message. If there's no error there's no message and nothing gets printed.
Post Reply