While inserting data in mysql database, data is inserting twice.
Here is my code
<?PHP
session_start();
require("connection.php");
$ques = $_POST['typeahead'];
$file_name = '';
$file_location = '';
$mess_detail = $_POST['message'];
$sqlInsert = "insert into querry (user, querry, file_name, file_location, message, date_added) values ('mayank', '".$ques."', '', '', '".$mess_detail."', NOW())";
if(mysql_query($sqlInsert, $conn))
{
echo "Successfully Updated....";
}
else
{
echo "Failed....";
}
?>
Here Is my table structure:
CREATE TABLE IF NOT EXISTS `querry` (
`querry_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID of Querry',
`user` varchar(20) NOT NULL COMMENT 'user who asked the querry',
`querry` varchar(255) NOT NULL,
`file_name` varchar(30) DEFAULT NULL,
`file_location` varchar(250) DEFAULT NULL,
`message` varchar(10000) DEFAULT NULL,
`date_added` datetime NOT NULL,
PRIMARY KEY (`querry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
I googled but no luck......