Need to add a where clause by default before page load
Need to add a where clause by default before page load
aswebtechnology
Posts: 19Questions: 0Answers: 0
Hi,
I am need to execute a query
$sql ="select name, address, city from users where user_type=1"
I have already added the fields name, address and city in array in server processing file but I need to have the clause where user_type=1 into it so that only records related to user_type = 1 should show up and further search / filtering is made on them.
Please help me to achieve it. Its really urgent for me. Thanks in advance.
I am need to execute a query
$sql ="select name, address, city from users where user_type=1"
I have already added the fields name, address and city in array in server processing file but I need to have the clause where user_type=1 into it so that only records related to user_type = 1 should show up and further search / filtering is made on them.
Please help me to achieve it. Its really urgent for me. Thanks in advance.
This discussion has been closed.
Replies
[code]
$sWhere = "WHERE user_type=1";
if ( isset($_GET['sSearch']) && $_GET['sSearch'] != "" )
{
$sWhere = " AND";
for ( $i=0 ; $i
Is there any way I can echo the ajax response or echo sql query used at ajax response in filtering the rows.
Any help will be highly appreciated.