PHP执行sql语句如何插入session值?
mysql_query("INSERTINTOsuggestionbox(suggestionTitle,suggestionContent,createTime,pos...
mysql_query("INSERT INTO suggestionbox(suggestionTitle,suggestionContent,createTime,postuser) VALUES ('$_iptTitle','$_iptContent',now(),$_SESSION['userName'])");
这句话是错的,就错在session值得插入格式,求正确写法 展开
这句话是错的,就错在session值得插入格式,求正确写法 展开
2个回答
展开全部
$postuser=$_SESSION['userName'];
mysql_query("INSERT INTO suggestionbox(suggestionTitle,suggestionContent,createTime,postuser) VALUES ('$_iptTitle','$_iptContent',now(),'$postuser')");
mysql_query("INSERT INTO suggestionbox(suggestionTitle,suggestionContent,createTime,postuser) VALUES ('$_iptTitle','$_iptContent',now(),'$postuser')");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询