This topic is locked

lookups

9/6/2007 4:22:39 AM
PHPRunner General questions
M
morpheus author

right, got my lookup tables working but had an idea.
How can i add a condition to the where statement in the second dropdown box of a linked pair that looks at its value and only gets values from the second table that match its criteria, that way I can use an ajax lookup.
if this question doesnt make sense I'll explain <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6190&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />
regards
Jason

M
morpheus author 9/6/2007

ok so build 303 fixes the problem, but how do i get it to look at any point IN the string in the ajax box and not just the first letter,
eg:
looking for cisco 837 router, type in 837.....ajax finds none, type in cisco....get 1000's to choose from <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=21156&image=1&table=forumreplies' class='bbc_emoticon' alt=':P' />
regards
Jason

right, got my lookup tables working but had an idea.

How can i add a condition to the where statement in the second dropdown box of a linked pair that looks at its value and only gets values from the second table that match its criteria, that way I can use an ajax lookup.
if his question doesnt make sense I'll explain <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=21156&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />
regards
Jason

Alexey admin 9/6/2007

You can make Ajax popup search for substrings in any place not in the beginning only.

Modify generated ..._lookupsuggest.php file

Find all occurencies of this line there:

$LookupSQL .= "BandName LIKE '".db_addslashes($value)."%'";

and replace them with:

$LookupSQL .= "BandName LIKE '%".db_addslashes($value)."%'";