Am trying to making a specific query as follow
$query = "SELECT * FROM users WHERE uid IN (1,10,50,60,94,102)";
how can i use a mysql escape string for where clause or if i just use it like that, is it ok?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The way you are doing now is not an
UPDATEquery. You are only retrieving records from the database. In order to update records from the database, you need to use theUPDATEDML. The syntax for that isReturning back to your question, the way you are doing the query doesn’t need
mysql_escape_stringbecause you are only passing integer values. Currently, more PHP developers are not usingmysql_escape_stringanymore because it’s already been discourage and as the PHP Manual site says this function is already depreciated. Alternatively, PDO_MYSQL or MYSQLi extensions should be used instead.