3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Import your Cafepress Shop Data into your own SQL Database

Step 4Use PHP to Randomly Display Products from SQL Database

Use PHP to Randomly Display Products from SQL Database
«
  • code1.png
  • code2.png
Now that drama is all done…whew!.. on to the fun stuff. My ultimate goal is to randomly display 5 featured products from my Cafepress shop on my mobile website. I am using PHP to query MySQL database and output the results on the page. Every new visit to the webpage or page refresh will display different products.

I referenced a combination of web tutorials…google is your friend :)
I will start will displaying the entire PHP code then follow it with a line by line explanation.

Refer to the attached images (code1.png and code2.png).  I had to attach screenshots of the code due to it not displaying properly in this Instructable.This code goes on the webpage that I want to display my products.

You can also visit my blog where I also have this posted.

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
Author:hexxamillion