jennlaz Posted February 3, 2011 Share Posted February 3, 2011 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 https://forums.phpfreaks.com/topic/226586-making-a-webpage-generated-from-mysql-database/ Share on other sites More sharing options...
fenway Posted February 13, 2011 Share Posted February 13, 2011 It doesn't have to be a page -- use a URL parameter -- and then you can get a pretty URL later. Link to comment https://forums.phpfreaks.com/topic/226586-making-a-webpage-generated-from-mysql-database/#findComment-1173573 Share on other sites More sharing options...
jennlaz Posted March 1, 2011 Author Share Posted March 1, 2011 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 https://forums.phpfreaks.com/topic/226586-making-a-webpage-generated-from-mysql-database/#findComment-1181487 Share on other sites More sharing options...
peterbarone Posted March 1, 2011 Share Posted March 1, 2011 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 https://forums.phpfreaks.com/topic/226586-making-a-webpage-generated-from-mysql-database/#findComment-1181604 Share on other sites More sharing options...
jennlaz Posted March 2, 2011 Author Share Posted March 2, 2011 I actually figured it out and the answer is a little embarrassing. I moved the $stock = $_GET['stock'] to above the select from and it worked. Lol Link to comment https://forums.phpfreaks.com/topic/226586-making-a-webpage-generated-from-mysql-database/#findComment-1181622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.