Jump to content

[SOLVED] Little help with some links please


Sorrow

Recommended Posts

Hi there here is my problem. I am doing a webpage for movie reviews. I have my reviews in a database. When I access the review page it display the list of the movie titles of all the reviews. each of them links to the same webpage. Here is what i want to do and cant figure out how.when i click on one of the link it needs to load the moviereview.php with the informations of the clicked link. but how can i select the right name that was clicked to access the right infos in my db???

Create the url with a variable equal to the unique id of the record i.e.

 

http://www.somepage.com?id=1234

 

Then use something like currId = $_GET['id'] to get the variable and use it in the query for the proper row like

 

SELECT * from table WHERE id = currID

 

 

Thank you it worked for the url but when i load my moviereview.php page nothing shows up.

here is my code:

 

the link that is in the adressbar is http://www.123.com/moviereview.php?index=1

 


<?php

include 'opendb.php';
$currIndex = $_get['index'];
$query  = "SELECT * FROM reviews where m_index = $currIndex";
$result = mysql_query($query);


while($row = mysql_fetch_array($result, MYSQL_ASSOC))

echo "{$row['m_Link']}";
{
    echo "<img src={$row['m_Link']}> <br> ".
 "{$row['m_Review']} <br> ";
}
mysql_close($con);


?>




Archived

This topic is now archived and is closed to further replies.

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