Page 1 of 1

Probably using £ symbol in code

Posted: Fri Aug 19, 2005 10:23 am
by ethoemmes
Hi

This should be easy. I have a script where I am trying to print the £ symbol. Whenever my browser displays this it puts  before the £.

Does anyone know why this is happening?

Code: Select all

<?php

include "config.php";

$table = "tblBooks";

// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());

// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());

// read data from database
$result = mysql_query("SELECT * FROM $table")
or die ("Could not read data because ".mysql_error());

// print the data in a table
if (mysql_num_rows($result)) {
print "<html><body>";
while ($qry = mysql_fetch_array($result)) {
print "<table cellpadding=2 cellspacing=0 border=0 width=\"100%\">";
print "<br>";
print "<tr><td>$qry[strAuthor]</td></tr>";
print "<tr><td>$qry[strTitle]</td></tr>";
print "<tr><td>$qry[strDescription]</td></tr>";
print "<tr><td>$qry[strAnnotation]</td></tr>";
print  "<tr><td> £ $qry[dPrice]</td></tr>";
print "</table>";
print "</html></body>";
}
}

mysql_close();

?>
http://www.rrbltd.com/Development/Read ... guev2.php

Thanks

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Aug 19, 2005 10:28 am
by patrikG
&pound;