paulmo Posted December 24, 2009 Share Posted December 24, 2009 I need help getting this query started, either nested loop or join. On one table, $word (which is a text string from form) gets matched to column 'good'; if match, $word gets matched to column 'keyword'; match on 'keyword' echoes same row id in 'echo_good' column to user. if no match on 'good', match against column 'bad' etc. if no match on good or bad but match on 'keyword', echo message to user to elaborate on keyword match. thanks in advance to someone who can get me off the ground on this one. Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/ Share on other sites More sharing options...
paulmo Posted December 24, 2009 Author Share Posted December 24, 2009 Someone who is good at queries please respond on this one. Thanks Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-983662 Share on other sites More sharing options...
fenway Posted December 27, 2009 Share Posted December 27, 2009 Match how? Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-984601 Share on other sites More sharing options...
paulmo Posted December 27, 2009 Author Share Posted December 27, 2009 like this: On one table, $word (which is a text string from form) gets matched to column 'good'; if match, $word gets matched to column 'keyword'; match on 'keyword' echoes same row id in 'echo_good' column to user. if no match on 'good', match against column 'bad' etc. if no match on good or bad but match on 'keyword', echo message to user to elaborate on keyword match. Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-984607 Share on other sites More sharing options...
fenway Posted December 28, 2009 Share Posted December 28, 2009 Well, if you're doing a dumb string match, then sure, you can see if substring matches are true or false for each column. Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-984721 Share on other sites More sharing options...
paulmo Posted December 28, 2009 Author Share Posted December 28, 2009 not sure how "dumb" figures but yes I'm looking at boolean true or falses for each column now. Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-984852 Share on other sites More sharing options...
fenway Posted December 28, 2009 Share Posted December 28, 2009 Then use LOCATE(). Link to comment https://forums.phpfreaks.com/topic/186205-nested-loop-or-join-help-please/#findComment-984929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.