Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
- array(&$stmt, 'bindparams')
- call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
- $stmt->bind_params($array_of_params[0], $array_of_params[1] ... $array_of_params[N])
- select * from mytable
- where status = ? and (userid = ? or ?)
- and (location = ? or ?)
- order by `date` desc, time desc
- limt ?
- $stmt = $mysqli->prepare( [statement above] );
- $stmt->bind_param( "siiiii",
- "active", $userid, $userid == "ALL",
- $location, $location == "ALL",
- $limit);
- $userIdEmpty = $userid == "ALL";
- $locationEmpty = $location = "ALL";
- $stmt->bind_param( "siiiii",
- "active", $userid, $userIdEmpty,
- $location, $locationEmpty,
- $limit);
Add Comment
Please, Sign In to add comment