Hi all
I ahve a script that calls records from a database. The search field is named "name". Some of the contents have an apostrophe on the end. i.e. Russell's Hospital.
If I echo the field "name" it returns the right record but in this format. Russell\'s Hospital. My script is putting a "\" in the result.
anyone know why this is.
THE CALLING SCRIPT.
while ($row = mysql_fetch_array($result))
{
// ... start a TABLE row ...
echo "\n<tr>";
echo "<tr bgcolor=\"#EDF3F2\" onMouseOver=\"javascript:this.style.backgroundColor ='#FFFF99'\" onMouseOut=\"javascript:this.style.backgroundColor ='#EDF3F2'\">";
?>
<td align="left"><font color="black\" face="arial\"size="1"> <a href=\"services/hc.php?idname=<? echo urlencode($row["name"]).">".$row["name"] ?></a>
</td>
<?
"\n\t";
echo "<td align=\"left\"><font color=\"#990000\" face=\"arial\"size=\"1\" >" .
$row["address3"] .
"\n\t";
"\n\t";
echo "</tr>";
// Finish the row
THE CALLED SCRIPT
$connection = mysql_connect($server, $user, $password);
mysql_select_db("db66511019", $connection);
$result = mysql_query("SELECT * FROM hospitals WHERE NAME = '$idname'" , $connection);
while ($row = mysql_fetch_array($result))
{
echo " <table width=100% border=0 cellspacing=0 cellpadding=0 background=../../Gif/Background.gif >";
echo "<tr>";
echo "</tr>";
echo "<tr>";
echo "<tr>";
echo "<td> </td>";
echo "</tr>";
echo "<tr>";
echo "<td> </td>";
echo "</tr>";
echo "<tr>";
echo "<td width=20% align=left><font face=arial size=2 color=red>Name</font></td>";
echo "<td><b>".$row["name"] . "</b></td>";
echo "</tr>";
Many thanks if you can help
Dereck