Bopo Posted November 3, 2008 Share Posted November 3, 2008 Hey Well I am totally new to php, first day (although I do .net programming) Anyway I was wondering if it is possible to use the limit & where clause together, Im guessing it probably doesn't make sense, but its an ideal solution to what I am trying to do, any advice appreciated. Link to comment https://forums.phpfreaks.com/topic/131205-using-limit-and-where-clause-together/ Share on other sites More sharing options...
revraz Posted November 3, 2008 Share Posted November 3, 2008 Yep, they are totally seperate and can be used together (this is a mysql question and not PHP though). SELECT * FROM table WHERE id='$id' LIMIT 1 Will return the first record that matches the query. Link to comment https://forums.phpfreaks.com/topic/131205-using-limit-and-where-clause-together/#findComment-681183 Share on other sites More sharing options...
Bopo Posted November 3, 2008 Author Share Posted November 3, 2008 My bad about not using the correct forum. Thanks for the example, It was just a case of moving the limit clause to the back of the query. Cheers Link to comment https://forums.phpfreaks.com/topic/131205-using-limit-and-where-clause-together/#findComment-681192 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.