Thursday, 29 August 2013

I'm trying to get some info from php to mysqli via post. Have a look can you see where I've stuffed up

I'm trying to get some info from php to mysqli via post. Have a look can
you see where I've stuffed up

Help I'm new to this and learning fast but i need help o see where I've
gone wrong
this is the Form
enter code here
<td>:</td>
<td><input name="lastname" type="text" ></td>
</tr>
<tr>
<td>Details</td>
<td>:</td>
<td><input name="details" type="text" ></td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" name="Submit"
value="Submit"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
this is the PHP page for processing and inputing into the Database
<?php
$name=$_REQUEST['name'];
$lastname=$_REQUEST['lastname'];
$details=$_REQUEST['details'];
//connect to Database
$link = new mysqli("localhost", "name", "pass", "DB");
//check connection
if (!$Link){
printf("Connect Failed: %s/n", mysqli_connect_error());
exit();
}
//turn auto commit off
mysqli_autocommit($link,FALSE);
mysqli_query ($link,"INSERT INTO IncidentDatabase (First_Name,
Last_Name,Inciden_Details) VALUES ('$name','$lastname','$details')");
/* commit transaction */
mysqli_commit($link);
/* close connection */
mysqli_close($link);
?>
thats the end of the question

No comments:

Post a Comment