Need to add a where clause by default before page load
Need to add a where clause by default before page load
![aswebtechnology](https://secure.gravatar.com/avatar/6ab534fba8b74451437031169c548da2/?default=https%3A%2F%2Fvanillicon.com%2F6ab534fba8b74451437031169c548da2_200.png&rating=g&size=120)
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.