Jump to content

mysql insert error


speedy_rudolf
 Share

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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.