MySQL Forums
Forum List  »  PHP

Re: INSERT Database Records with PHP
Posted by: Rick James
Date: August 09, 2013 08:01PM

If the user enters
O'Henry
you will have trouble with quotes. Learn about escaping.

Use VARCHAR, not CHAR for variable length strings.

echo $query;
so you and we can see what the SQL actually looks like.

In this:
$result = $db->query("INSERT ...");
$result will be TRUE or FALSE. See http://php.net/manual/en/mysqli.query.php

Options: ReplyQuote


Subject
Written By
Posted
Re: INSERT Database Records with PHP
August 09, 2013 08:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.