chanfuterboy Posted September 26, 2009 Share Posted September 26, 2009 hi, I made a dictionary script. Now I enter 1 word it change good. But if i want to put more words like a sentece, it show nothing, because it read only in one row in db. How i need to modify the script, so the result can read from more row in db. the script are below. $word=$_POST['word']; $conv=$_POST['conv']; if($conv=="d2p") { $sSQL = "select papiamento from woordenboek where dutch1='$word'"; $result = mysql_query($sSQL); $row = mysql_fetch_row($result); echo "<h3>$row[0]</h3>"; } else { $sSQL = "select dutch from woordenboek where papiamento1='$word'"; $result = mysql_query($sSQL); $row = mysql_fetch_row($result); echo "<h3>$row[0]</h3>"; } Quote Link to comment https://forums.phpfreaks.com/topic/175603-dictionary/ Share on other sites More sharing options...
chanfuterboy Posted September 26, 2009 Author Share Posted September 26, 2009 let me do a e.g. in table 1. Walk | Lopen. table 2. Move | Bewegen. So when i choose Walk result come lopen. And if i choose Move result Bewegen. Now what i want is if i choose Walk Move, the result need to come Lopen Bewegen. In the script above it come no result because it does not search for more that 1 word help Quote Link to comment https://forums.phpfreaks.com/topic/175603-dictionary/#findComment-925322 Share on other sites More sharing options...
.josh Posted September 26, 2009 Share Posted September 26, 2009 $words = "Walk Move"; $words = explode(' ',$words); $words = "'". implode("','",$words) . "'"; $sSQL = "select dutch from woordenboek where papiamento1 in ($words)"; Quote Link to comment https://forums.phpfreaks.com/topic/175603-dictionary/#findComment-925375 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.