Help: problem getting data from database

i’m getting data into my flash from a PHP file, and the information is passed from my mysql database. it’s names of businesses, addresses, etc.

my problem is that some business names have “&” in them. i could go into the database and change all of them to “and”, but it doesn’t make much sense… and if any new businesses will be added (and they can be added automatically by users) i’ll still have this problem.
my romance with PHP is just beginning, so if anyone can show me how to change my PHP so it converts “&” to “%26” automatically, i would be most thankful.

:afro:

here is my code:


$query  = "SELECT * FROM phpbb_users WHERE user_address_state like 'NY' ORDER BY user_school_name";
$result = mysql_query($query);

if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result))
{
	echo "<span class='school_name'>{$row['user_school_name']}</span><br>";
	echo "<span class='school_info'>{$row['user_address_street']}, {$row['user_address_city']}, {$row['user_address_state']}, {$row['user_address_zip']}, {$row['user_address_country']} <a href=\"http://maps.google.com/maps?f=q%26hl=en%26q={$row['user_address_street']} {$row['user_address_city']} {$row['user_address_state']} {$row['user_address_zip']}\" target=\"_blank\">[Map]</a></span><br>";
	echo "<span class='school_info'>Tel. {$row['user_contact_phone']} | Fax. {$row['user_contact_fax']} | {$row['user_school_director_title']}: {$row['user_school_director_name']}</span><br>";
	echo "<span class='school_info'>email. <a href=\"mailto:{$row['user_contact_email']}\">{$row['user_contact_email']}</a> | web. <a href=\"http://{$row['user_contact_website']}\" target=\"_blank\">{$row['user_contact_website']}</a></span><br> <br>";
}
} else {
echo "<span class='school_name'>There are no schools in this locale.</span>";
}