Hi Guys,
could use a little help with a script im trying to write… It’s not outputting the way I want it to, and I’m not sure where I’m going wrong. My php/mysql skills are not that good, It’s all new to me.
I’m pretty sure i’ve set the database up correctly, however i think there’s something wrong in the while loop in my script. Can anyone help? or point out anything else that looks wrong too?
It’s supposed to display a link to the pdf that is related to the keyword. I’ve had it working in the past where it displays the actual pdf, but i need it to list hyperlinks instead as its more practical if there are multiple results.
Sorry If i’m not making sense…
<?php include 'connect.php'; $result = mysqli_query($con,"SELECT * FROM pdfs WHERE Keywords LIKE '%stu%'"); $kword = $row['Keyword']; $count = 1; echo ("Your search results for ".$kword. "are below"); while($row = mysqli_fetch_array($result)) { $pdf=$row['FILENAME']; echo ("<a href='http://www.mysite.co.uk/$pdf</a>"); } mysqli_close($con); ?>