Jump to content

I am working on a project from a text book and I get this error -- Deprecated: mysql_real_escape_string():


Olympus

Recommended Posts

I am working on a project at the end of a text book called Beginning PHP MySQL Development which is published by Pawprints Learning Technologies.   I am developing the files in NetBeans and using WAMP server. I get this error from the process_insert.php file "Deprecated: MySQL_real_escape_string():..." 

 

I can't copy and paste so I attached my files.  Can anyone help?

 

 

 

 

 

 

Add Product_php.htm

index.php

add_product.php

process_insert.php

db.connect.php

Link to comment
Share on other sites

Most likely you are using the mysql extension, and are using PHP >= 5.3. PHP has deprecated the mysql driver, which means it's going to be totally removed from PHP in an upcoming version. You should be using the PDO (1st choice) or MYSQLi extension and forget that the original MYSQL extension exists if you want to better future proof your code.

 

See the PHP notes: http://php.net/manual/en/migration55.deprecated.php

More here: http://php.net/manual/en/intro.mysql.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.