I have just started on my profile script. My first task is to pass a variable through the URL address in the following format
profile.php?user_id=2
A small section of code I currently have is below:
if ((!isset($_SESSION['username'])) || (empty($_SESSION['username'])))
{
header("Location: /members_only.php");
exit();
}
$user_id = $_GET['user_id'];
$result = mysql_query("SELECT * FROM cms_users WHERE user_id = '$user_id'");
$result = mysql_result($result, 0);
The error message returns:
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 4 in blah blah blah
Any ideas?
Am I passing the variable correctly?