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>"; } 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 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)"; Link to comment https://forums.phpfreaks.com/topic/175603-dictionary/#findComment-925375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.