I have a table gquestions
with columns id
,answer
,date
. I'm trying to update string in table with this HTML form and PHP queries:
HTML
<form action="/reply" method="post">
<textarea name="answer"></textarea><br>
<input type="submit" value="Reply">
</form>
PHP
$p_answer = $_POST["answer"];
$time = time();
mysql_query("UPDATE gquestions SET answer='$p_answer' AND date='$time' WHERE id='1'");
echo "UPDATE gquestions SET answer='$p_answer' AND date='$time' WHERE id='1'";
Okay, in form I'm typing in textarea Test and clicking Reply and get this result in page:
UPDATE gquestions SET answer='Test' AND date='1490982467' id='1'
but in table I get 0 instead of Test in answer
column. Why I'm getting 0 in my column?