Have to be a bit more specific, cause I can't reproduce your
problem... Do you have some code examples that show it clearer?
name for client is "COMPANY #1" in DB
<?php
include "dbconnect.inc"; //sets up db connection
$sel = mysql_query("select name from client
where clntid='1000'", $connection);
$result = mysql_fetch_object($sel);
$name = $result->name;
echo "This is the name: $name<br>";
?>
Output:
This is the name: COMPANY #1
A # sign is just another character in HTML, and all php is doing is
creating the html for you. the # sign would only effect a difference in
PHP code within the <?php ?>, which when you are doing a query that
doesn't happen.
--
Tom
On Wed, 11 Dec 2002 15:45:18 -0800
Mike Smith <[EMAIL PROTECTED]> wrote:
> I have a string I'm returning from a database. Some entries have #
> signs
> in the names ie (COMPANY #42, COMPANY #43...). When I display
> results
> all I have is COMPANY. Everything after the # is dropped off. I tried:
>
> If ($cust) {
> $cust2=ereg_replace('#','no',$cust);
> //tried $cust2=ereg_replace("#","no",$cust); too
> }
>
> but that still returns the same thing (COMPANY).
>
> Also tried:
>
> $cust2 = preg_replace ("'&(pound|#163);'i", chr(163), $cust);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php