Website: http://gift-for-men.com/
PHP Version: 5.0
Alright, what my website does is automatically generate a "Gift" suggestion whenever someone visits "Gift-For-Men.Com." That's exactly what I wanted and exactly what I built. Anyways, the problem I ran into is I wanted to implement social features like the Facebook like button. After looking through books, google, and more I finally decided I can't figure it out on my own. So if you could please help me out by answering the question.
Question: What I want is when the person visits the page it automatically generates a "suggestion" as it's doing. But when it generates that suggestion it adds the primary id to the end of the URL. For Examample I want to URL to be "http://gift-for-men.com/ "id?=1" The "id" is just text I added to make it look prettier instead of being http://gift-for-men.com/1. The code I used to build the suggestions is below.
Explanation: The QUERY is stored in the variable $row. The primary key in the database is named id. Any ideas please?
Code: Select all
<?php
$query = "SELECT * FROM suggestions ORDER BY Rand() LIMIT 1";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
?>