Jump to content

escaping needed with select


rubing

Recommended Posts

I use the improved mysql functions to escape my data prior to insertion (e.g. mysqli_real_escape_string), so a subtle question arises.

 

Do I query as follows:

 

$query="SELECT cola FROM table.a WHERE colb='$var'";
$conn->query($query);

 

Or like this:

$var = $mysqli->real_escape_string($var);
$query="SELECT cola FROM table.a WHERE colb='$var'";
$conn->query($query);

 

Link to comment
https://forums.phpfreaks.com/topic/117952-escaping-needed-with-select/
Share on other sites

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.