Hi, first of all, please accept my apology if i am going about this the wrong way and what i'm doing is really silly, im a newbie to PHP so sorry for any ignorance. Oh and sorry if you don't understand what i'm asking, its hard to put into words 🙂
ok, well, this is just an example. From a html file i have links:
<a href="track.php?cat=1">click</a>
<a href="track.php?cat=2">click</a>
and in track.php i want it to take the value cat, i.e. 1 or 2 or 3 depending on the link and display the right message from a database.
database is set out
text commment
1 yippee
2 whoopee
so if <a href="track.php?cat=2">click</a> is clicked, the message whoopee is displayed, etc. i have this script so far but it wont work and i dunno why 🙁
<?php
$db = mysql_connect("localhost", "username","password");
mysql_select_db("database",$db);
{
$result = mysql_query("SELECT * FROM table WHERE text = $HTTP_GET_VARS['cat'],$db);
}
echo $result;
?>
Thanks for taking time to read this, if you understood i that is 🙂
Ant