Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3968034
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:47:35+00:00 2026-05-20T03:47:35+00:00

I have a search field, and using that single text box I want the

  • 0

I have a search field, and using that single text box I want the user to be able to find both galleries and images by their name. The problem I’m having is that I don’t seem to be able to get any results on my queries, even though the syntax is fine and I get no errors.

Here’s the scenario: My group name is “Liten gruppe!”, and the search string is “liten”. Both the search string and result string is switched to lower case for non-case sensitive search.

Something in the syntax must be doing something I’m not expecting.

SELECT `id`
FROM gallery_groups
WHERE   `name` LIKE LOWER('%$searchstring%') OR
        `date_created` LIKE LOWER('%$searchstring%');

Thanks for any help


EDIT: OK, that was a stupid mistake. But the correction still yields no results:

SELECT `id`
FROM gallery_groups
WHERE   LOWER(`name`) LIKE '%$searchstring%' OR
        LOWER(`date_created`) LIKE '%$searchstring%';

EDIT: Interesting! Copying the resulting query directly into PhpMyAdmin results in a match. It does NOT result in any rows when called from PHP however. How can that be?


EDIT: OK, it turns out that the query does indeed return 1 result. I was fooled by the dump output of the result:

object(mysqli_result)[3]
  public 'current_field' => null
  public 'field_count' => null
  public 'lengths' => null
  public 'num_rows' => null
  public 'type' => null

If all the fields in the result are null, how can I possibly know if there are any results other than running fetch_object() ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:47:35+00:00Added an answer on May 20, 2026 at 3:47 am

    I’m assuming you’re using msql_query to get your result object, in which case you can use mysql_num_rows to get the number of rows in the result.

    http://php.net/manual/en/function.mysql-query.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a location search field that I want to accept pretty much
I have a search field and the text is fired against CoreData using: produkt.name
first of all I'm using MySql. I have to create a advance search field
I have one table view that should be filtered by values of search field
Does jqGrid just have any callback after single field search? The onSearch callback fires
I have an ASP.NET page that contains two div's. Both have search fields and
i have a form that have a field which hold query for search and
I have a ASP.NET form that has a search box, with a Go button.
I have a search feature using PHP that offers either the option to search
I'm using iOS 5.0.1, and Sencha Touch 2-rc1. I have a search input field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.