MySQL Forums
Forum List  »  PHP

Selecting data works "SOMETIMES" !
Posted by: Milan Gajic
Date: August 17, 2005 02:29AM

Hi there!
I have a problem when selecting data form a database usina a simple form.
My select statement is fairly simple (PHP):

$q = "SELECT pesma, url FROM nostalgija WHERE pesma LIKE \"%" . $st . "%\"";
$result = mysql_query($q);

The weird thing that I get is this:

- When I search for "tamna" for example I get the results that I expect to see.
- One of theese results is "Riblja Corba - Tamna je noc"
- Now I try searching for "Corba", "orba", "rba" and "orb" which should give me at least one result (step 2), but instead nothing is returned.
- Searching for "ba" on the other hand returns all expected results, including everything containing the string "Corba"

I have tried replacing the variable with the search string in the code itself, but the results were unchanged.

The same select statement works just fine in the command line mysql client.

The form in question can be viewed at:
http://www.milangajic.com/tst1.php
The web-server is on a non-standard port in the 5000-range, so it might not be available on some networks behind a firewall.
It is the one on the left, labeled "JAVNA SEKCIJA".

Any help is appreciated.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.