Page 1 of 1

T_LNUMBER error

Posted: Sat Jan 07, 2006 11:53 am
by spyro
twigletmac | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I have a script and when I add two lines I get certain error, any ideas?

Original code snippet

Code: Select all

$sqlquery="GRANT ALL PRIVILEGES ON `$username` . * TO '$username'@'localhost' WITH GRANT OPTION";
mysql_query($sqlquery);
New snippet

Code: Select all

$sqlquery="GRANT ALL PRIVILEGES ON `$username` . * TO '$username'@'localhost' WITH GRANT OPTION";
mysql_query($sqlquery);
$sqlquery="INSERT INTO `quota` VALUES ('$username', '50000000', 'N');
mysql_query($sqlquery);
When I add the code in the new snippet I get the following error.

Parse error: parse error, unexpected T_LNUMBER in /var/www/html/components/com_registration/registration.php on line 176


twigletmac | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Jan 07, 2006 12:01 pm
by timvw
The second query string is missing a " to indicate the end of the string. If you used the

Code: Select all

tags on this forum or a decent editor with syntax highlighting you probably would have found it yourself..

Posted: Sat Jan 07, 2006 12:05 pm
by spyro
Thanks, guess sometimes and extra pair of eyes helps. I was doing it in vi which obviously isn't the best for coding.

Posted: Sat Jan 07, 2006 12:23 pm
by Jenk

Code: Select all

$sqlquery="GRANT ALL PRIVILEGES ON `$username` . * TO '$username'@'localhost' WITH GRANT OPTION";
mysql_query($sqlquery);
$sqlquery="INSERT INTO `quota` VALUES ('$username', '50000000', 'N');
mysql_query($sqlquery);
and it all becomes clear ;)

Posted: Sat Jan 07, 2006 3:27 pm
by timvw
spyro wrote:Thanks, guess sometimes and extra pair of eyes helps. I was doing it in vi which obviously isn't the best for coding.
Vi Improved aka vim is the way to go ;) Probably want to look for a php extension :)