Jump to content

mysql_real_escape_string() problem


robert_gsfame

Recommended Posts

$query = "SELECT * FROM " . $table . " WHERE " . mysql_real_escape_string($search) . " LIKE '%" . mysql_real_escape_string($data) . "%' AND user_id=" . (int)$userid;

 

Assuming a valid mysql connection has been previously establised, $table is safe (hardcoded) data supplied by yourself and userid is an integer.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.