I am having problems with getting an apostrophes to show. I don't know whether it is a mysql problem, or with php3.

On page viewinfo1.php3, I have:

<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
&lt;table border="0" width="700" cellspacing="0" cellpadding="0"&gt;

&lt;form action="validate.php3" method="post"&gt;
&lt;p&gt;&lt;select name="sel_game" size="6"&gt;
&lt;?php
mysql_connect (localhost, usernaname, password);
mysql_select_db (mydb);
$query = "SELECT * FROM gameinfo ORDER BY game";
$gameinfo = mysql_query($query) or die("Select Failed!");
while ($gamename = mysql_fetch_array($gameinfo)) {
echo "&lt;option value='",$gamename['game'],"'&gt;";
echo $gamename['game']," (",$gamename['platform'],")";
echo "&lt;/option&gt;";
} ?&gt;
&lt;option&gt;---------------------------------------------------------&lt;/option&gt;
&lt;/select&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;
&lt;input type="submit" value="Go"&gt; &lt;/p&gt;
&lt;/form&gt;

[/code]

This dynamically produces a select box, 6 lines deep, showing all the games in the database (from the query). When you select a game, and hit submit, it transfers the game name to validate.php3 as $sel_game. Here, a game with the name of "Sarge's Heroes" will show up right, with the apostrophe in the right spot.

My validate.php3 code:

<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
&lt;?php
mysql_connect (localhost, username, password) or die("Unable to Connect to MySQL Server");
mysql_select_db (mydb) or die("Unable to select DB");
$query="select id, publisher, description FROM gameinfo WHERE game='$sel_game'";
$game_array=mysql_query($query) or die("Publisher Select Failed!");
$game_info=mysql_fetch_array($game_array);
$game_id=$game_info['id'];
$game_publ=$game_info['publisher'];
$game_desc=$game_info['description'];

?&gt;

&lt;table border="1" width="700"&gt;
&lt;tr&gt;
&lt;td width="13%"&gt;*&lt;/td&gt;
&lt;td width="72%"&gt;You selected Game : &lt;?php echo $sel_game ?&gt;&lt;/td&gt;
&lt;td width="15%"&gt;*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="13%"&gt;*&lt;/td&gt;
&lt;td width="72%"&gt;The ID for this game is : &lt;?php echo $game_id ?&gt;&lt;/td&gt;

&lt;td width="15%"&gt;*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="13%"&gt;*&lt;/td&gt;
&lt;td width="72%"&gt;The Publisher for this game is : &lt;?php echo $game_publ ?&gt;&lt;/td&gt;
&lt;td width="15%"&gt;*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="13%"&gt;*&lt;/td&gt;
&lt;td width="72%"&gt;The Description for this game is :&lt;br&gt;&lt;br&gt; &lt;?php echo $game_desc ?&gt;&lt;/td&gt;
&lt;td width="15%"&gt;*&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

[/code]

This takes the passed variable $sel_game and looks it up in the database to get the publisher, id number, and description to display it. However, when I run across a game like "Sarge's Heroes", the processing stops after the apostrophe. The HTML is still shown, however, nothing past the apostrophe is shown from the database. This code works for any other game name, and even works with apostrophes in the description field.

The game name and publisher fields are varchar's, and the description area is a blob.

Again, Any help is greatly appreciated.

Mike



[This message has been edited by mmccue (edited March 07, 2000).]