[Solved] Php function doesn’t run [closed]


$book=mysql_real_escape_string($_POST['books']);
$sql="INSERT INTO books (bID, book) VALUES ('','$book')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error($con));
}`   <---  Here is a rogue quote..

The syntax highlighter if StackOverflow spotted this problem. Do you use an editor with a highlighter too?

Since the code is now invalid, PHP cannot parse the file and will fail. It doesn’t matter that you don’t actually execute this piece of code, because the whole file is parsed. This is different from runtime errors, which occur after the code is parsed and when the code is executing. In your case, the error occurs before any PHP code is executed at all.

1

solved Php function doesn’t run [closed]