Forum Moderators: coopster

Message Too Old, No Replies

Strange error

Parse error: parse error, unexpected T_LNUMBER

         

rokec

2:59 pm on Sep 26, 2006 (gmt 0)

10+ Year Member



what's wrong with this code?
line 19:
if($_POST['miners']*500+$_POST['magicians']*800+$_POST['knights']*1200+$_POST['rangers']*1500>$fdatabase['gold']){echo("false!");}

I got error:

Parse error: parse error, unexpected T_LNUMBER in /home/www/xyz.php on line 19

jatar_k

3:40 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that line doesn't give me a parse error

take a look at the line(s) above that one to see if the error is trickling down

look for mismatched ' " {}[]() or a missing ;

rokec

2:00 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



Yes but $fdatabase is a row in a table. with [''] i'm getting the right col variable. Maybe that is causing the error.

Suprising that that line isn't causing errors wheh you tried it. When i remove that line, my code is working normally. So problem IS in this line.

jatar_k

5:24 pm on Sep 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, if you take a look at this
[php.net...]

T_LNUMBER is a problem with integers

try spacing out that line, like so, maybe it is just that

if($_POST['miners'] * 500 + $_POST['magicians'] * 800 + $_POST['knights'] * 1200 + $_POST['rangers'] * 1500 > $fdatabase['gold']) echo("false!");

also you don't need the braces as there is a single line for your if ;)