SELECT DATA WITH FORM GALLERY | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

SELECT DATA WITH FORM GALLERY

Hello I need help with php code. I work on a site that show items like cups and plates. I want to show the items from my database with the picture that related to the item. In addition when I click the item I want to see the details of the item in the next page (also by select from the database). Can someone help me with this code? That is the page of the gallery of items: <?php require_once("targil6connection.php"); { $link=connectdb(); $sql="SELECT `Image` ,`Name` FROM `silverware` "; $results=$link->query($sql); if ($results===false) { echo "error in query"; } else { foreach($results as $oneresult) { echo $HTML='<div class="gallery"> <a target="_blank" href='. "{$oneresult['Image']}".'> <img src='."{$oneresult["Image"]}".' alt="Trolltunga Norway" > </a> <div class="desc"> '. "{$oneresult["Name"]}".' </div> <a href="PRODUCTPROJECT.PHP" class="button"> Buy</a></div>'; } } } ?> That is the page of the product details: <!-- About Section --> <div class="w3-row w3-padding-64" id="about"> <div class="w3-col m6 w3-padding-large w3-hide-small"> <img src="pic/sacoum1.jpg" class="w3-round w3-image w3-opacity-min" alt="Table Setting" width="600" height="750"> </div> <div class="w3-col m6 w3-padding-large"> <h1 class="w3-center">FILET TOIRAS</h1><br> <h5 class="w3-center">4536</h5> <p class="w3-large w3-text-black w3-hide-medium"><H1>Description:</H1> <BR> FLATWARE SET 72 PCS H.H. ORFEVRE <BR>Material: Silverplated nickel-silver </p> <p class="w3-large w3-text-black w3-hide-medium">Price: 120

lt;/p> Thank u!

18th Feb 2018, 1:23 PM
Danna IL
Danna IL - avatar
1 Answer
0
Post what have you done already.
17th Feb 2018, 11:57 PM
Toni Isotalo
Toni Isotalo - avatar