Jump to content

Making a webpage generated from MySQL database


jennlaz

Recommended Posts

I'm currently attempting to create my FIRST database driven website, and have hit a serious snag.

 

I'm creating a page that syndicates from another site via .csv, which lists inventory for a car dealership. I've generated the first page successfully, where all of the inventory is listed with a brief description (inventory.php), but now I have to figure out a way to make these descriptions link to a page with more info on the vehicle. Since the inventory will be syndicating from another location, I'd like for these pages to be automatically generated.

 

Now, I am NOT a developer by any stretch of the imagination (front end designer ONLY!), so I'll give an example to try and explain this better.

 

Lets say I have 2 cars in my inventory - a 2008 Dodge Caliber (Stock Number 001) and a 2004 Toyota Echo (Stock Number 002). I've created the inventory.php page where it shows a brief description of the car and an image, and would like the image and description to link to a page generated by the database ("2008-dodge-caliber-001.php" and "2004-toyota-echo-002.php"). How do I make the database automatically create these pages, and how do I link to them from the inventory.php page?

 

I know this is a lot to ask, but if someone could provide me with a code snippet and a layman's terms it would be BEYOND appreciated!

 

Thank you to all who reply!!

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Okay, thank you! I got that part figured out!! Now I'm having another issue (I am not by any means a programmer)..

 

What I did with the parameter was had it send to another page (www.URL.com/page.php?stock=NUMBER). Now I'm trying to have that page display only the data relating to that row of information, using the "SELECT * FROM TABLE1 WHERE STOCK=$stock" (I specified elsewhere that $stock = $_GET['stock'];)..

 

But now when I use the "where" function it won't display any of my data. I had it working where it would display one row of data when I manually typed in the stock number, but now that's not working anymore. I don't have a great grasp of code, so I'm trying to play it by ear here.

 

Any suggestions?

 

Thanks guys!

Link to comment
Share on other sites

I'm no pro by any means either. So I run into the same issues you do. First place to start echo $stock somewhere on the page make sure it is being set.  I have also noticed that with some php vers.

 

Select * from table1 where stock= '$stock';

 

If you need php for repeating table let me know

 

Hope that helps a little one noob to another. Lol

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.