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!
// example
<?php
$foo = 'bar'
$bar = 'foo';
// Opps, forgot the ; on the first row. Makes it think I'm...
$foo = 'bar' $bar = 'foo'; // ...which is bad.
?>
It's abit tricky sometimes as the line with the error not allways needs to refer to the actual error (typos, chars missing) but where it actually breaks so to speak.
i also took out the lines regarding sessions (not commented, but removed entirely) and it kinda worked ... i think it has something to do with sessions.
IT'S ALWAYS THE STUPID THINGS THAT GET ME OFF
i'm going to try adding the session stuff again and i'll see if that works, thanks for that help ... but what does that original error mean.
$qry = "string";
$qry = $var;
$qry = 1; // a number
...but as you are missing the ", it continues until the next ". So far, so good (even if it's at that point actually broken )
It finds the next ", and then wants a ; after that as in my first example here above. But it's not there, so it breaks!
Hence your original post about getting a parse error on a row, thats commented out...
$lid = mysql_connect($hst, $usr, $pwd);
$qry = "select * from user where name = '$uid';
$rsl = mysql_query($qry);
if (mysql_num_rows ($rsl) == 0) {
$_SESSION['a'] = $a; // no users by provided name available
echo "user doesn't exist ...";
}
and all i get is an echo back of user doesn't exist ... but i think i can figure this ... thaks guys again.
The error
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/http/public_html/acs/index.php on line 23
Is telling you that it expects a STRING a VAR or a NUMSTRING and it stops at line 23
Therefore, you need to look at line 22 for any missing ",;,' etc...
On line 22 you are missing the " at the end of your query statement. Fixing that will clean up that error.