louroberto Posted February 16, 2011 Share Posted February 16, 2011 Hello all, I am new to php and was wondering if i could get some guidance here. I am using phpAdmin 2.6.0 and running Mysql 4.1.21. here is my situation.... I have a script that allows us to upload a new product name, product code, category and a PDF file to the data base. There is also a folder on the server that has the PDF files in it. I think I deleted the code on the page (library.php) that displays the files for the client to download. My goal here is after I upload everything I want it to then be displayed on the page with a link to the PDF file. Here is the page that has the links on it. I hope that I explained this correctly. I am not a programmer but do have some idea and have been reading up on php to try and figure this out. I am looking to create the script that would display the links on the library.php page. Any help would be great. The other link is to the script that allows us to upload. www.pennstateind.com/library.php www.pennstateind.com/lib-admin.php Quote Link to comment Share on other sites More sharing options...
louroberto Posted February 16, 2011 Author Share Posted February 16, 2011 OK so I am trying to figure out how to get things to display unique files for each product code and name. I posted some other threads but got no response and I am working through the code as a newbie. I am running Mysql 4.1.2 and I am trying to display a product code, product name and also in this display link to the appropriate pdf file for download. I got this far but now I need to link each product code to the PDF file for that product code. Cant seem to make the connection. any takers? <?php $username="root"; $password=""; $database="psi"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM library"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b>Pen Kits</b><br><br>"; $i=0; while ($i < $num) { $productcode=mysql_result($result,$i,"product_code"); $productname=mysql_result($result,$i,"product_name"); echo "<b><a href='library/PK-PEN_ins.pdf'>$productcode</b>: $productname</a><br>"; $i++; } ?> Here is the link to the page www.pennstateind.com/display-products.php Thanks any helpers... Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 16, 2011 Share Posted February 16, 2011 Please keep one problem to one thread. Also, since this is really a php issue, I'll move the thread to PHP coding help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.