PHP error please help
Posted: Thu May 25, 2006 10:15 am
Hi everyone
i have this code but it gives this error and i cant see where its coming from please could someone help
rse error: parse error, unexpected $ in /home/reeceth/public_html/game/buyfone.php on line 28
i cant see a $ i dont know if i have missed something of left something open
this is my code
Thanks a lot
reece
i have this code but it gives this error and i cant see where its coming from please could someone help
rse error: parse error, unexpected $ in /home/reeceth/public_html/game/buyfone.php on line 28
i cant see a $ i dont know if i have missed something of left something open
this is my code
Code: Select all
<?php
include('config.php');
// Connect to server and select database.
mysql_connect("localhost","reeceth_12","dell12")or die("cannot connect server ");
mysql_select_db("reeceth_12")or die("cannot select DB");
$phones=$_POST['phones'];
$sql="SELECT * FROM gameinfo WHERE username ='reece";
$result1=mysql_query($sql1);
$rows=mysql_fetch_array($result1);
$money=$rows['money'];
//$cost = 'cost of article purchased';
//$availableCash = 'amount of money the user has';
if($phones > $money) {
echo "Not Enough Money";}
else {
$moneyLeft = $money - $phones;
$query = "UPDATE gameinfo SET money=$moneyLeft WHERE username='reece';
$result=mysql_query($query);
}
?>reece