0
Pls, can any one tell me what is worng with this code?
when i run it , this is what i get

[There was an error with the database. It has been logged.]

any help?
Thanks.

<?php
session_start();
$navtype = $_GET["nav"];
include "config.php";
?>

<?php

	if($navtype == "mail")
	{
	
		 $username = $_POST['username'];
		 $title = $_POST['title'];
		 $description = $_POST['description'];
	 
		 $sql = "INSERT INTO inbox (username, title, description, datesent, timesent)
		 VALUES('$username', '$title', '$description', NOW(), CURTIME())";
		 
		 "$qsuccess = mysql_query($sql)";

		 
if(!$qsuccess)
{
     error_log("Query failed.  MySQL error: " . mysql_error() . "\nQuery submitted: " . $sql . "\n", 3);
     die("There was an error with the database.  It has been logged.");
}

		 echo "<center><p><br><br><br><strong>The new $title has been added to the database</strong></p></form>";
	
	}
?>
3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Javvy
0

why using " at line 27

"$qsuccess = mysql_query($sql)"

try without:

$qsuccess = mysql_query($sql);
0

why using " at line 27

"$qsuccess = mysql_query($sql)"

try without:

$qsuccess = mysql_query($sql);

i have more errors when it is not there.

0

i have more errors when it is not there.

oh,ok. i have done that and it is still not working, thanks for your help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.