Parse Error: Unexpected $

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
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Parse Error: Unexpected $

Post by Citizen »

Parse error: parse error, unexpected $ in /home/xx/public_html/rPicker.php on line 12
I get that from running this code:

Code: Select all

<?php

if ($_SESSION['loggedin']) {

$dbh=mysql_connect ("localhost", "xx", "xx") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("xx");

$sql="SELECT * FROM `accounts` WHERE points > 1 ORDER BY RAND() LIMIT 1";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$selaccount = $row["account_id"];
?>
I'm not seeing anything wrong... any ideas?
Last edited by Citizen on Tue Mar 21, 2006 8:41 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

match up your brace pairs
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Post by Citizen »

Thanks! Sorry for the stupid mistake. :(
Post Reply