PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi All
Can some please tell me what is wrong with this query it’s bringing out the Duplicate results according to $pagesize . As it is now it’s bringing out same result three times. Why??? I have inserted the query into phpMyAdmin its working fine bringing out one result. Some help will be greatly appreciated. Thanks
I try to avoid using SELECT * unless I absolutely am sure I want to support a dynamic number of things to reference in the future...plus when posting because I know one of our fellow forum members prefers it.
I recommend saving the query but not executing it and then using a print_r function to echo the output...run it through MySQL (I use phpMyAdmin) and tinker with the query from there. Really sometimes you just have to keep messing with it...what happens if I change...remove...add...etc.
Plus I know OR and AND in MySQL have different functions...are you absolutely sure you are using them together in the desired context? I always sort of thought of how OR is used as more of an AND method but I'm hardly a pro with MySQL. It's just what sort of stands out to me. Try switching that around in example and good luck!
What do you mean by "duplicate results"? Do you mean that it is returning 3 rows with the same data? Also, you haven't shown any code for fetching rows from the results array. Hopefully you are doing that. Finally, default the recordstart to 1, not 0.
I try to avoid using SELECT * unless I absolutely am sure I want to support a dynamic number of things to reference in the future...plus when posting because I know one of our fellow forum members prefers it.
I recommend saving the query but not executing it and then using a print_r function to echo the output...run it through MySQL (I use phpMyAdmin) and tinker with the query from there. Really sometimes you just have to keep messing with it...what happens if I change...remove...add...etc.
Plus I know OR and AND in MySQL have different functions...are you absolutely sure you are using them together in the desired context? I always sort of thought of how OR is used as more of an AND method but I'm hardly a pro with MySQL. It's just what sort of stands out to me. Try switching that around in example and good luck!