Hi, i have created a basic script to write to a database and a few errors happen:
1st it puts it into the database twice :s i rly dont know y and im not refreshing.
2nd i need to to be able to catch the error message the sql brings back if there is an error.
Here is the source code can someone please look at tell me whats wrong lol
[code=php]
<?php
$conn = mysql_connect(“localhost”, “k0m0d0”, “ragnarok”);
mysql_select_db(“ebay”,$conn);
$sql = “insert into nametable values(‘$_POST[name1]’, ‘$_POST[name2],’, ‘$_POST[name3]’, ‘$_POST[name4]’)”;
$result= mysql_query($sql, $conn);
if (mysql_query($sql, $conn)) {
echo “success! o/”;
} else {
echo “no works”;
}
?>