Jump to content

mysql insert error


speedy_rudolf

Recommended Posts

Hi. I think you all know me by now so I'll cut to the chase.

<?php
$host="edited";
$username="edited";
$password="edited";
$db_name="edited";
$tbl_name="topic";
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

$name=$_POST['name'];
$detail=$_POST['details'];

$sql="INSERT INTO $tbl_name(topic, detail, datetime)VALUES('$name', '$detail', NOW())";
$result=mysql_query($sql);

if($result){
header("location:site.html");}
else{
echo("I have failed you master.");}
?>

 

Displayed error: "I have failed you master." Anyone know a possible cause? Thanks. Bye.

Link to comment
https://forums.phpfreaks.com/topic/214288-mysql-insert-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.