Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Need help troubleshooting search in PHP.

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

MicroGuy

Miembro EspecialTop Member
Impact
1,493
This is a snip of PHP code that is not working properly.

The search form is displayed but "Nothing was found by your request. Try to redefine search terms" is returned when searching by string. The search by date part works great?

Any help you be greatly appreciated.

PHP:
function display_search_form(){
    global $db, $t;

    $t->assign('az', get_az());

    $products = & $db->get_products_list();
    $pp = array();
    foreach ($products as $p) $pp[ $p['product_id'] ] = $p['title'] ;
    $t->assign('products', $pp);

    $user_fields = array();
    foreach ($GLOBALS['member_additional_fields'] as $f){
        if ($f['name'] == 'is_locked') continue;
        if ($f['name'] == 'i_agree') continue;
        if ($f['name'] == 'is_approved') continue;
        if ($f['type'] == 'hidden') continue;
        $user_fields[$f['name']] = $f['title'];
    }
    $t->assign('member_fields', $user_fields);

    $t->display('admin/user_search.html');
}

function search_by_string(){
    global $q, $q_where;
    global $db, $t;
    $ul = & $db->users_find_by_string($q, $q_where);
    if (count($ul) == 0){
        $t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
        display_search_form();
        return;
    }
    global $all_count, $count, $start;
    $all_count = count($ul);

    $ul = @array_slice($ul, $start, $count);
    $t->assign('ul', $ul);

    $t->display('admin/user_search_res.html');
}

function search_by_product(){
    global $product_id, $include_expired;
    global $db, $t;
    $ul = & $db->users_find_by_product($product_id, $include_expired);
    if (count($ul) == 0){
        $t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
        display_search_form();
        return;
    }
    global $all_count, $count, $start;
    $all_count = count($ul);

    $ul = @array_slice($ul, $start, $count);
    $t->assign('ul', $ul);

    $t->display('admin/user_search_res.html');
}

function search_by_date(){
    global $search_type;
    global $db, $t;
    set_date_from_smarty('date', $_GET);
    $ul = & $db->users_find_by_date($_GET['date'], $search_type);
    if (count($ul) == 0){
        $t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
        display_search_form();
        return;
    }
    global $all_count, $count, $start;
    $all_count = count($ul);

    $ul = @array_slice($ul, $start, $count);
    $t->assign('ul', $ul);

    $t->display('admin/user_search_res.html');
}
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Anyone....I'll pay $$.
 
0
•••
the code you provided really is not going to help at with finding the problem.

Try finding the sql and echoing this out, it is possible it is invalid
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back