exl08 Posted September 29, 2008 Share Posted September 29, 2008 I have a website that uses a mysql database for its shopping cart, what i am wanting to do is attach a script to the front page that pulls the name, image and price of a product from mysql database and also will have do it randomly so every time you visit it will be different. Only prob is i have tried searching the net for a script to modify but cannot find one that does what i want it to do. Im pretty new to php so the more you can provide the best here are the details you may need. the table name is called mod_product and the fields i want to use are product_img and product_name product_price so it shows in that order but in the database they are in a different order if that matters. thanks Link to comment https://forums.phpfreaks.com/topic/126217-picking-random-products-from-mysql-database-php-code/ Share on other sites More sharing options...
fahim_junoon Posted September 29, 2008 Share Posted September 29, 2008 Hi Not sure if this will solve your problem but have you tried ORDER BY RAND() on the sql query? Link to comment https://forums.phpfreaks.com/topic/126217-picking-random-products-from-mysql-database-php-code/#findComment-652687 Share on other sites More sharing options...
exl08 Posted September 29, 2008 Author Share Posted September 29, 2008 i dont have a clue where to start on the script itself, i was hoping someone could post a script that would do what i am looking for. please help me thanks Link to comment https://forums.phpfreaks.com/topic/126217-picking-random-products-from-mysql-database-php-code/#findComment-652789 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.