This won't work for me, I have been using inserts and every other sql statment there on this work, but for some reason this is not working.
The table below is structured as follows.
**passenger_journey**
j_id user_id
142 1
142 14
Below all I'm trying to do is insert the logged in users id which is the $user_id and the journey id which is $id. Thee are working are the variables are set.
I think a possible problem may be the $id as I'm getting this from the url using the GET method.
<?php
$insert_passenger = "INSERT INTO `passenger_journey` VALUES ('" . mysql_real_escape_string($id) ."','" . mysql_real_escape_string($user_id) . "')";
if (isset($_POST['submit'])){
mysql_query($insert_passenger);
}
?>
<form method="POST">
<br/>Add yourself to this journey!<br/>
<input type ="submit" value="Sign up for this Journey"/>
</form>
This has been driving me mad for hours any help would be great.