hi guys i am quite new to php and mysql data bases and i am having some trouble with my site i am making. I have a page which is meant to add a new item into a table called ‘my_build’, the code below is what i have but i doesn’t seem to be working and i amn’t getting any error with it either. Can any one with this?
[php]<?php
$con = mysqli_connect(“localhost”, “root”, “”, “Computers”);
if ( isset($_POST[‘serial_no’]) && isset($_POST[‘description’]) && isset($_POST[‘price’])
&& isset($_POST[‘fname’]) && isset($_POST[‘lname’]) )
{
$s = mysql_real_escape_string($_POST[‘serial’]);
$d = mysql_real_escape_string($_POST[‘description’]);
$p = mysql_real_escape_string($_POST[‘price’]);
//$sql = “INSERT INTO my_build
(Serial_no, Description, Price)
//VALUES (’$s’, ‘$d’, ‘$p’)”;
echo “
\n$sql\n\n”;
mysqli_query($con, “INSTER INTO
my_build
(serial_no, description, price) VALUES (’$s’, ‘$d’, ‘$p’)”);echo ‘Success - Continue…’;
return;
}
mysqli_close($con);
?>
Add A New User
Serial_no:
Description:
Price:
[/php]