I have a table in a database that i’m showing all tweets in a page, so how would i go about clicking a single tweet on the page and going to a new page that just shows that one tweet.
Some sort of GET through the href?
This is my PHP code:
while ($row = mysql_fetch_array($result)){
echo "<p>" . $row['tweet'] . "</p><br />";
}
Make each tweet a link pointing to some page and pass the id of that tweet to the page:
Then on singlepage.php, you’d basically have the same code as the page listing all the tweets, except that it would include the sql “where tweed_id = ” . $_GET[‘id’], so you’d only get that one result.
Be sure to validate your input so that if someone tweaks the URL and changes the ID, then they can’t insert malicious sql commands.