<?php
//Create a connection
$link = mysql_connect("db.telana.com", "maffelu", "xeno2409");
//Select database
mysql_select_db("examples", $link);
//Create a query
$sql = "INSERT INTO Person (Name, Age, Gender) VALUES ('Olov', 21, 'Male')";
//Execute the query
$result = mysql_query($sql, $link);
if($result)
{
//If correct, output result
echo "The last inserted record has id ".mysql_insert_id();
}
else
{
//If the query was unsucceful, we will output the error
echo "<b>Error ".mysql_errno($link).":</b> ".mysql_error($link);
}
//Close the connection
mysql_close($link);
?>
There are no comments on this article.
If you have any question or just want to leave a message, just fill out the form below!
Your e-mail will not be visible in your post, it is for validation reasons only