techker Posted August 27, 2008 Share Posted August 27, 2008 hey guy im making a car website for my buddy and i have a featured cars on the front page. now in my database i added a field featured im using this SELECT * FROM db WHERE featured ORDER BY RAND() on my page i added 4 boxes with code but i replicates it 4 times each featured car..all i one is 4 diffrent featured cars... Link to comment https://forums.phpfreaks.com/topic/121493-select-question/ Share on other sites More sharing options...
bluejay002 Posted August 27, 2008 Share Posted August 27, 2008 am not sure if i get it right but how many featured cars are stored in the field featured? I do not know the structure so I do not know how i can help you. Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626537 Share on other sites More sharing options...
techker Posted August 27, 2008 Author Share Posted August 27, 2008 i got it going.but i need to space them out evenly.. see front page you see fetured cars i want 4 pics. in my admin panel when he adds a car i added a field feature or not. if it is he puts 1 to 5 SELECT * FROM employees WHERE featured ORDER BY RAND() LIMIT 1 , 4 http://canada-auto.com/site/view_test.php Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626540 Share on other sites More sharing options...
Ken2k7 Posted August 27, 2008 Share Posted August 27, 2008 I don't get the SQL part where it says "WHERE featured". Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626710 Share on other sites More sharing options...
techker Posted August 27, 2008 Author Share Posted August 27, 2008 featured is the table name.. Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626783 Share on other sites More sharing options...
webent Posted August 27, 2008 Share Posted August 27, 2008 According to your sql statement, isn't "employees" the table name? Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626786 Share on other sites More sharing options...
techker Posted August 27, 2008 Author Share Posted August 27, 2008 sorry the cell name i put this it works put the space between the pics is to mutch? div.thumb { float: vertical; width: 25%; border: thin silver solid; margin: 0.5em; padding: 0.5em; } Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626787 Share on other sites More sharing options...
techker Posted August 27, 2008 Author Share Posted August 27, 2008 i think im getting there.i forgot to close my div tag Link to comment https://forums.phpfreaks.com/topic/121493-select-question/#findComment-626791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.