i use apache php mysql on my pc, and version of php is 5.2.6.
this is driving me crazy, it works when i changed table name "post" to "message", which is another table that has the same setting in mysite database. but it does not work with "post" table, any one can help, pls?
many thanks in advance
here is my code:
---------------------connection.php-------------
<?php
$connection=mysql_connect("localhost","root","") or die("fail to connet database!".mysql_error());
mysql_select_db("mysite",$connection) or die("fail to connet database!".mysql_error());
?>
---------------------end--------------------------
<?php include("../accessory/connection.php"); ?>
<?php
session_start();
if($_SESSION["username"]=="")
{
echo "<script>window.location='../index.php';alert('login pls!');</script>";
exit;
}
else
{
$name = $_SESSION["username"];
$subject = $_POST[subject];
$title = $_POST[title];
$limit = $_POST[limit];
$content = $_POST[content];
$mysql = mysql_query("insert into post (name,subject,title,limit,content) values ('$name','$subject','$title','$limit','$content')",$connection);
echo "<script>window.location='createpostdone.php';alert('done');</script>";
}
?>
i have tested those variables with alert function, they all have values. it's strange😕😕