Jump to content

Display script....


louroberto

Recommended Posts

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

Link to comment
Share on other sites

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...

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.