Kryptix Posted December 23, 2009 Share Posted December 23, 2009 I'm making a little search script that simply does the following: SELECT * FROM `rscd_objects` WHERE `object` = '" . $db->escape(trim($_POST['object'])) . "' OR `x` = '" . $db->escape(trim($_POST['x'])) . "' OR `y` = '" . $db->escape(trim($_POST['y'])) I just searched for '999'9 in $_POST['object'] and got the following results: Can anyone explain why that's happening? I just want it to select the last entry. Quote Link to comment https://forums.phpfreaks.com/topic/186134-search-results/ Share on other sites More sharing options...
rajivgonsalves Posted December 23, 2009 Share Posted December 23, 2009 your got an OR so it will search in this case 1) object = 999 2) x ='' (0) 3) y ='' (0) if anyone of these conditions are fulfilled it will show the row you should leave out the x and y or change your OR to AND with the proper x and y Quote Link to comment https://forums.phpfreaks.com/topic/186134-search-results/#findComment-982986 Share on other sites More sharing options...
Quantum1982 Posted December 23, 2009 Share Posted December 23, 2009 Greetings. Yes I agree with the previous statement. I have some experience in SQL, but my main problems are usually getting all the software and the drivers to work together on my computer. I am using PHPDesigner 7. I can't connect to MYSql database. Also php code just doesn't want to run. Here are the screens: Thanks Quote Link to comment https://forums.phpfreaks.com/topic/186134-search-results/#findComment-983009 Share on other sites More sharing options...
Quantum1982 Posted December 23, 2009 Share Posted December 23, 2009 Sorry here is the file [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/186134-search-results/#findComment-983014 Share on other sites More sharing options...
rajivgonsalves Posted December 23, 2009 Share Posted December 23, 2009 Quantum1982 would love to help, please create a new topic with the problem your facing, you will get better responses. Quote Link to comment https://forums.phpfreaks.com/topic/186134-search-results/#findComment-983081 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.