php - Database Query setup
The DB columns are |name|userID|lastname|UserPass|age|gender| i am building a query to select multiple results in one request
global $wpdb;
$res = $wpdb->get_results( $wpdb->prepare(
"SELECT name, lastname
FROM datatable
WHERE userID in ( %d , %d)
AND
UserPass in ( %d, %d )",
array(
$val[1],
$val[2],
$val[3],
$val[4],
)
),
ARRAY_A
);
where $val[1] and $val[2] should be uset as userID, and $val[3] and $val[4] UserPass. And i think i have problem with ordering the placeholder values and that the query is not setup properly, could use a word of advice.
Answer
Solution:
Try with this :
Answer
Solution:
This query returns all the users that match the given passwords.
Maybe this helps?