jwwceo Posted December 14, 2007 Share Posted December 14, 2007 $query="INSERT INTO reservations (package_id,user_id,ccnum,exp_date,avs,total,num_people,) VALUES('$_SESSION['packageid_v']','$_SESSION['user_id_v']','$_SESSION['ccnum_v']','$_SESSION['expdate_v']','123','$_SESSION['total_v']','$_SESSION['numpeople_v']')"; I get an T_ENCAPSED_AND_WHITESPACE error. But can't see why? JW Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 14, 2007 Share Posted December 14, 2007 Your getting it because of the multiple quotes used incorrectly. Try <?php $query="INSERT INTO reservations (package_id,user_id,ccnum,exp_date,avs,total,num_people,) VALUES('{$_SESSION['packageid_v']}', '{$_SESSION['user_id_v']}', '{$_SESSION['ccnum_v']}', '{$_SESSION['expdate_v']}', '123', '{$_SESSION['total_v']}','{$_SESSION['numpeople_v']}')"; ?> Ken Quote Link to comment Share on other sites More sharing options...
xiao Posted December 14, 2007 Share Posted December 14, 2007 And maybe remove the last comma in $query="INSERT INTO reservations (package_id,user_id,ccnum,exp_date,avs,total,num_people,) (the one after num_people) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.