What is wrong with this query: "SELECT * FROM table WHERE id = $_POST[ 'id' ]"?
student
Writing is my profession! I have written hundreds of article for many organizations and looking forward to work with growing organization. I am compatible to produce content in many categories including International politics, Healthcare, Education, Lifestyle, etc.. I understand the value of your time that you have invested to read my bio. #thanks
The use of table keyword it displays error when we execute the query SELECT * FROM table WHERE id = $_POST[ 'id' ]'?
Never use user input directly in queries.
This works:
$_POST['id'] = 27;
$sql = 'SELECT * FROM table WHERE id = $_POST[ 'id' ]'; echo $sql;
l = 'SELECT * FROM table WHERE id = $_POST[ 'id' ]';
echo $sql;