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 Link to comment https://forums.phpfreaks.com/topic/81730-solved-why-is-this-query-giving-errors/ 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 Link to comment https://forums.phpfreaks.com/topic/81730-solved-why-is-this-query-giving-errors/#findComment-415081 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) Link to comment https://forums.phpfreaks.com/topic/81730-solved-why-is-this-query-giving-errors/#findComment-415082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.