ukgoped
07-13-2005, 03:46 AM
<?php
include("config.php");
// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());
$username = mysql_real_escape_string($_COOKIE['loggedin']);
$query = "SELECT * FROM users WHERE username = \'$username\'";
$rs = mysql_query($query);
$data = mysql_fetch_array($rs);
$firstname = $data['firstname'];
echo "Welcome to Your Account, $firstname";
?>
Can someone please help me get this piece of code right..
This is the error i get atm..
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ukgoped/public_html/pedads/account.php on line 41
Welcome to Your Account,
Any help will be appreciated!!
include("config.php");
// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());
$username = mysql_real_escape_string($_COOKIE['loggedin']);
$query = "SELECT * FROM users WHERE username = \'$username\'";
$rs = mysql_query($query);
$data = mysql_fetch_array($rs);
$firstname = $data['firstname'];
echo "Welcome to Your Account, $firstname";
?>
Can someone please help me get this piece of code right..
This is the error i get atm..
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ukgoped/public_html/pedads/account.php on line 41
Welcome to Your Account,
Any help will be appreciated!!