I'm learning how to code from a textbook and it gives an example how to add data into a table using placeholders however it does not show how to add data to only specific columns. This is what I came up with
if (isset($_POST['title']) &&
isset($_POST['author']) &&
isset($_POST['isbn']))
//This checks to see if there is a value inputted into the form at the bottom
{
$title = get_post('title');
$author = get_post('author');
$isbn = get_post('isbn');
//This retrieves information from the user and assigns it to a variable
$q = 'PREPARE statement FROM "INSERT INTO classifieds(title, author, isbn)'
. 'VALUES(?,?,?)"';
mysql_query($q);
$q = 'SET @title = "$title",' .
'@author = "$author",' .
'@isbn = "$isbn",';
mysql_query($q);
$q = 'EXECUTE statement USING @title,@author,@isbn';
mysql_query($q);
$q = 'DEALLOCATE PREPARE statement';
mysql_query($q);
}
echo <<<_END
<form action="PSBE_POST_AD.php" method="post">
Title <input type="text" name="title" />
Author <input type="text" name="author" />
ISBN <input type="text" name="isbn" />
<input type="submit" value"Post Classified" />
</form>
_END;
?>
However, whenever I submit my information into the browser, I check to see if it was added via phpmyadmin and it is not. I'm making a classified website and I'll need the highest security and that's why I chose to use placeholder. I've tried looking online for a solution using many different syntax's but none of them work. So what is wrong with this code? Any advice will be appreciated.