Hello There Iam Sorry My problem Will take Time To Explain So Iam Sorry For That
first thing that's my code in the index file
<?php
$result = mysql_query("SELECT * FROM games");
while($row = mysql_fetch_array($result))
{
echo "Game Name : <a href='GameDetails.php?id=$row[id]'>$row[name]</a><br/>";
echo "Genre : $row[genre]<br/>";
}
?>
In The Past I Was Using This Code In The Add Game Form
<form name='vbform' method="post" action="Game_Insert.php">
Game Name : <input type="text" name="name" size="50" maxlength="150" />
Genre :
<select size="1" name="genre">
<OPTION value="Action">Action</OPTION>
<OPTION value="Rpg">Rpg</OPTION>
<OPTION value="Strategy">Strategy</OPTION>
</select>
Everything Was Ok And Cool
But I Was In Need Of A Search Page That Get All games Under This Genre
So I Made The Genre Dynamic (( Like The Sections ))
Now My Code In The Add For Look Like This
Genre : <select size="1" name="genre">
<?php
include("config.php");
$sql = mysql_query ("SELECT * FROM genre order by id ASC") or die ("error");
while($genre=mysql_fetch_array($sql))
{
echo "<OPTION value='$genre[id]'>$genre[name]</OPTION>";
}
?>
</select>
Now Its Insert The Id Of The Genre In The Database Instead Of The Name Of The Genre
The Images Will Explain More
Here It Show ID ( 1 ) Instead Of ( Action )
http://www.daniweb.com/forums/attachment.php?attachmentid=22647&stc=1&d=1319151363
http://www.daniweb.com/forums/attachment.php?attachmentid=22648&stc=1&d=1319151363
All I Need Now Is To make My First Code Show The Genre Name In Index File
Instead Of The Id Of The File :(
Iam Very Sorry For My Bad English
I Forget To Say
Genre Now In Separate Table And Have Its Own ID , Name