t encapsed whitespace problem
Posted: Tue Jun 13, 2006 7:18 pm
i think i have asked enough simple/dumb questinos,but here is another one. I have this code:
It tells me :
Code: Select all
if($_SESSION['in'] != 'yes' ) {
echo '<font color=red>You are not logged in,please go <a href="../admin">Here</a> to login.</font>';
}
else {
/*the action page.all actions of the admin will be redirected here.
That is all*/
$act = $_GET['act'];
$entry = $_GET['entry'];//the id of the entry
if($act == 'approve') {
$query = "SELECT * FROM poffers WHERE id=$entry";
$result = mysql_query($query);
$data = mysql_fetch_array($result,MYSQL_ASSOC);
$sql2 = "INSERT INTO coffers(username,offer_name,offer_type) VALUES ($data['username'],$data['offer_name'], $data['offer_type'])";
$sql2run = mysql_query($sql2);//inserts the offer to completed table.
//remove it from the old table
$put = mysql_num_rows($sql2run);
if($put == 1) {
$delete = "DELETE FROM poffers WHERE id=$entry LIMIT 1";
$delrun = mysql_query($delete);
$hits = mysql_num_rows($delrun);
if($hits == '1') {
echo 'The offer' .$entry.'has been removed from pending offers and has been moved to completed offers.';
}
else{
echo 'The entry was not added.';
}
}
}
}im pretty sure there is no white space on that line. by the array. i think it might be problem with array though.Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampplite\htdocs\admin\do.php on line 26