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>";
	
	}
?>

why using " at line 27

"$qsuccess = mysql_query($sql)"

try without:

$qsuccess = mysql_query($sql);

why using " at line 27

"$qsuccess = mysql_query($sql)"

try without:

$qsuccess = mysql_query($sql);

i have more errors when it is not there.

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.

echo $_GET[navtype] first..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.