Jump to content

[SOLVED] Quickie, cant spot parse error?!


herghost

Recommended Posts

Perhaps my eyes or tired or I am just being stupid, but I can see my parse error!

 

<?php
session_start();

include('include/database.php');

$sql = "SELECT * FROM user WHERE userid='" . mysql_escape_string($_POST['userid'])'";
$result = mysql_query($sql, $link) or die("There was an error while trying to get your information.\n<!--\n" . mysql_error($link) . "\n-->");
if(mysql_num_rows($result) < 1)
{
    $_SESSION['SESS_USERID'] = $_POST['userid'];
    redirect('index.php?p=signup');
}
$_SESSION['SESS_USERID'] = mysql_result($result, '0', '	userid');
$_SESSION['SESS_BANDNAME'] = mysql_result($result, '0', 'bandname');
$_SESSION['SESS_USERNAME'] = mysql_result($result, '0', 'username');


?>

 

Its on line 10 which is:

 

 $_SESSION['SESS_USERID'] = $_POST['userid'];

 

Anyone see it?

Link to comment
https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/
Share on other sites

$sql = "SELECT * FROM user WHERE userid='" . mysql_escape_string($_POST['userid']) . "'";

 

$_SESSION['SESS_USERNAME'] = mysql_result($result, '0', 'username');

 

Syntax error, get a program that highlights your code and it will be easy to see (as it is plain as day in this forum).

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.