Could someone please help. I've searched alot of forums and website but none seem to give me the answer.
I've posted info to my database and i'm looking to return the id using the mysqli_insert_i d() function. I'm posting it to php. Please someone help, going a bit mad as no integer is returned.
[CODE=MYSQL]
$query ="INSERT INTO New_Fault(Title ,Forename,Surna me,Email,Messag e)
VALUES('$Title' ,'$Forename','$ Surname','$Emai l','$Message')" ;
$result = mysqli_query($c xn,$query) or die ('error making query');
if($result){
echo "Your unique Reference Number is = " mysqli_insert_i d;
echo "<BR>";
echo "<a href=' put link here'>Back to main page</a>";
}
else {echo "ERROR";
}
mysqli_close();
?>
[/CODE]
Thanks G
I've posted info to my database and i'm looking to return the id using the mysqli_insert_i d() function. I'm posting it to php. Please someone help, going a bit mad as no integer is returned.
[CODE=MYSQL]
$query ="INSERT INTO New_Fault(Title ,Forename,Surna me,Email,Messag e)
VALUES('$Title' ,'$Forename','$ Surname','$Emai l','$Message')" ;
$result = mysqli_query($c xn,$query) or die ('error making query');
if($result){
echo "Your unique Reference Number is = " mysqli_insert_i d;
echo "<BR>";
echo "<a href=' put link here'>Back to main page</a>";
}
else {echo "ERROR";
}
mysqli_close();
?>
[/CODE]
Thanks G
Comment