Probably using £ symbol in code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ethoemmes
Forum Commoner
Posts: 26
Joined: Thu Aug 18, 2005 4:11 pm

Probably using £ symbol in code

Post 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]
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

&pound;
Post Reply