MySQL Forums
Forum List  »  PHP

Re: jquery update database
Posted by: Peter Brawley
Date: March 23, 2015 01:22PM

The mysql API is deprecated. Use mysqli.

To see the actual query ...

$qry = "SELECT * FROM house WHERE id = $id";
echo $qry;

.. and paste what displays into the mysql client to debug.

> $id = trim($_REQUEST['name']);

Always run such input through mysqli_real_escape_string.

You always need to poll for errors in any function call that can fail, ie

$conn = mysqli_connect(...) or exit( mysqli_connect_error() );

...mysqli_query(...) or exit( mysqli_error($conn) );

Options: ReplyQuote


Subject
Written By
Posted
March 23, 2015 11:38AM
March 23, 2015 12:37PM
March 23, 2015 12:42PM
Re: jquery update database
March 23, 2015 01:22PM
March 23, 2015 01:46PM
March 23, 2015 03:49PM
March 23, 2015 04:25PM
March 23, 2015 04:44PM
March 24, 2015 09:25AM


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.