Hello!
I've been into mysql and encountered a problem, not serious one but it is bugging me.
I can do dynamic page linking as follows, in short hand....
echo "<a href=\"foo.php?page=" . $vastaus['id'] ."\">" . $vastaus['menu_name'] . "</a><br />"; // URL LINK
function showcontent() { /// FUNCTION TO DISPLAY CONTENT FROM SERVER.
global $yhteys;
$sql = "SELECT * ";
$sql .= "FROM subjects ";
$sql .= "WHERE id=" . $_GET['page'];
$kysely= mysql_query($sql, $yhteys);
$content = mysql_fetch_assoc($kysely) or die(mysql_error());
echo strip_tags($content['content'], "<br><dt><dl>");
Problem is... I can make this work with the ID, how ever, i want the URL bar saying it like this -> index.php?page=Info.
This way it looks smarter (tells more to a user) and not just numbers as IDs.
If i try to do the query like this...
$sql = "SELECT * ";
$sql .= "FROM subjects ";
$sql .= "WHERE menu_name=" . $_GET['page'];
It says unknown column "Info, Services". etc etc.
It can only regonize the first column in each row. ( aka the id=number)
I've tryed num_rows, fetch_array and fetch_assoc. I can't find a way to accomplish it.
PLEASE i know this is simple, need help.
Thanks in advance!