My code is quite simple.It is about submit some data to mysql database. It did work to use normal way to submit data like query(). Code is here:
$con = new mysqli('127.0.0.1','xxx','xxx','xxx');
$con->query("SET NAMES 'utf8'");
$stmt=$con->prepare("INSERT INTO comments (Nickname, Content, Img) VALUES (?, ?, ?)");
$stmt->bind_param('sss', $nickname, $comments, $proc_comments);
$stmt->execute();
When I submitted to this php webpage, it did not pointing out any mistakes. I'm a university student who are not majoring CS or other relative subjects.Please help me.Thanks.
Update: This following code can work on the lnmp platform.
$con = new mysqli('localhost','user','passwd','database_name');
$con->query("SET NAMES 'utf8'");
$stmt=$con->prepare("UPDATE comments SET Likes=Likes+1 WHERE Num=?");
$stmt->bind_param('i',$favor_num);
$stmt->execute();
Last update: I try to check Nginx's error log to see if there is any mistake I missed, but it did not have any problem relative to this strange thing.