herghost Posted April 12, 2009 Share Posted April 12, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/ Share on other sites More sharing options...
premiso Posted April 12, 2009 Share Posted April 12, 2009 $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). Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807964 Share on other sites More sharing options...
wildteen88 Posted April 12, 2009 Share Posted April 12, 2009 The real problem is not on line 10. Its actually on line 6 (near the end). Have alook at your post above and see what I'm talking about. The syntax highlighting in your post above gives it away Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807967 Share on other sites More sharing options...
jackpf Posted April 12, 2009 Share Posted April 12, 2009 Notepad++. Mandatory. Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807971 Share on other sites More sharing options...
mrMarcus Posted April 12, 2009 Share Posted April 12, 2009 what is redirect('index.php?p=signup'); ? Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807975 Share on other sites More sharing options...
wildteen88 Posted April 12, 2009 Share Posted April 12, 2009 what is redirect('index.php?p=signup'); ? Most probably a call to a custom function Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807979 Share on other sites More sharing options...
herghost Posted April 12, 2009 Author Share Posted April 12, 2009 what is redirect('index.php?p=signup'); ? A function I made up, that doest exist! I think the way that I am going about doing this is incorrect anyway, I will post a new topic and see what comes of, it, thanks for your help guys Quote Link to comment https://forums.phpfreaks.com/topic/153745-solved-quickie-cant-spot-parse-error/#findComment-807980 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.