无法调用数据库有关问题

WBOY
Release: 2016-06-13 10:20:20
Original
898 people have browsed it

无法调用数据库问题
我是在ubuntu 下面,用的eclipse pdt,conn.php用来链接数据库,显示已成功,于是
include 'conn.php';
if ($_POST['submit'])
{

$sql="insert into BBS (ID,user,title,content,lastdate) values ('','$_POST(user)','$_POST(title)','$_POST(content)',now())";
mysql_query($sql);
echo 'success';
}
?>


user:

title:

content:


一个小表单,输入以后,提交,显示success,但是为什么数据库中没有插入的信息呢?百思不得起解。。。。开始以为是sql语句错了,于是在phpmyadmin下输入sql语句,正确执行。哪里错了呢??

------解决方案--------------------
不可能是版本的问题
mysql_connect(...);
mysql_select_db('数据库名');
你是这样用的么?
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template