T_LNUMBER error

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!

Moderator: General Moderators

Post Reply
spyro
Forum Newbie
Posts: 2
Joined: Sat Jan 07, 2006 11:51 am

T_LNUMBER error

Post 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]
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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..
spyro
Forum Newbie
Posts: 2
Joined: Sat Jan 07, 2006 11:51 am

Post 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.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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 ;)
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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 :)
Post Reply