Jump to content

Query not returning right - there IS a match


Go to solution Solved by kernelgpf,

Recommended Posts

I am trying to run queries against a table and running into very confusing problems. I keep returning "0" rows for obvious matches - attached is a screenshot of an example (query+"no results" and picture of table with value being searched for (perfect match).

 

I've been pulling my hair out on this for hours - help and TIA!

post-22563-0-82430700-1376367395_thumb.png

Edited by kernelgpf

I trimmed both values first, thanks anyway =/ nothing in the table will match properly - I'm actually writing a script to check against the incidentID and I started testing on the intersection field as well, something is wrong with the table I feel.

Trim would only handle spaces at the beginning and end of a string. It wouldn't help with any space variations in the middle of the string.

 

For instance if your database contained the value

1500  LA  BRANCH
(two spaces between words) your query would fail to match, even though it would appear as though it should when viewing the record in phpMyAdmin. Edited by kicken

Okay I found the problem but am still unsure how to fix it - the string in the database has odd question mark black symbols - how can I remove them/unformat the string?

 

"�1�4�0�0� �W� �W�E�S�T� �L�P� �S� �7�0�0� �P�O�S�T� �O�A�K� �B�L�V�D��"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.