1
mjoel
mysql_real_escape_string XOOPS replacement ?
  • 2017/2/22 13:53

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


since mysql_real_escape_string is deprecated

if i have this code
$employee_id mysql_real_escape_string($_GET['id']);

what should i replace it with

2
aerograf
Re: mysql_real_escape_string XOOPS replacement ?
  • 2017/2/22 14:35

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


$employee_id mysqli_real_escape_string($_GET['id']);

3
Mamba
Re: mysql_real_escape_string XOOPS replacement ?
  • 2017/2/22 22:20

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


"deprecated" is not a problem - it's just info to the developer that one they in the future it will be removed.

So you can ignore it.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

4
geekwright
Re: mysql_real_escape_string XOOPS replacement ?

The BEST way is to do this:
$employee_id $xoopsDB->escape($_GET['id']);


That will continue to work no matter what the underlying database driver is in the future.

Quote:

mjoel wrote:
since mysql_real_escape_string is deprecated

if i have this code
$employee_id mysql_real_escape_string($_GET['id']);

what should i replace it with

5
mjoel
Re: mysql_real_escape_string XOOPS replacement ?
  • 2017/2/23 14:34

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Thank you geekwright..this is working for me

Quote:

geekwright wrote:
The BEST way is to do this:
$employee_id $xoopsDB->escape($_GET['id']);


That will continue to work no matter what the underlying database driver is in the future.

Quote:

mjoel wrote:
since mysql_real_escape_string is deprecated

if i have this code
$employee_id mysql_real_escape_string($_GET['id']);

what should i replace it with

Login

Who's Online

184 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 184


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits