$extraWhere = '..... LIKE ..... OR ..... LIKE ..... ';
$extraWhere = '..... LIKE ..... OR ..... LIKE ..... ';
fc338339
Posts: 16Questions: 8Answers: 1
common WHERE CONDITION in sql :
WHERE s.surname LIKE '%abc%' OR m.phone_1 LIKE '%9100%'
BUT how to apply by $extraWhere for server-side scripting ?
I have tried but failure as :
$filter_1 = isset($_GET['phone_num'])?$_GET['phone_num']:0;
//filter recordset according to currently selected row
if (isset($_GET['phone_num'])) {
$filter_1 = $_GET['phone_num'];
unset( $_GET['phone_num'] );
}
$filter_2 = isset($_GET['stud_name'])?$_GET['stud_name']:0;
//filter recordset according to currently selected row
if (isset($_GET['stud_name'])) {
$filter_2 = $_GET['stud_name'];
unset( $_GET['stud_name'] );
}
:
:
:
$joinQuery = "FROM {table} AS h ........ ";
$extraWhere = ' m.phone_1 LIKE \'%'.$filter_1.'%\' ' OR ' s.surname LIKE \'%'.$filter_2.'%\' ';
Thanks
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
What is the error that occurs when you try the above? What is the SQL that is generated? Have you updated the demo server-side processing script to allow joins to operate (the default doesn't allow that)?
Allan