Re: Putting quotes in?
| From: | CC Zona | Date: | Wed, 09 May 2001 04:57:23 +0000 |
| Subject: | Re: Putting quotes in? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52024@lists.php.net to get a copy of this message | ||
In article <004401c0d83d$c711a180$da7a0341@cdrrpd1.ia.home.com>,
ender@particlesun.com ("Ender") wrote:
> Okay I am taking a number from a mySQL database and I want to put quotes on
> that number?
>
> How would I do this?
>
> $databasenumber = 123.123.123.123;
>
> How do I make
> $databasenumber = "123.123.123.123";
>
> To:
> runprogram("hls",$databasenumber);
Either you're confused...or I am. <g> Are you thinking that the string
must have quotes wrapped around it before it can be used as a parameter to
a function? 'Cuz it's already coming out of the database as a string;
despite the fact that the $databasenumber value gives the appearance of
being a "number", it's not a numercial datatype such as an integer or a
float--it's a string. You should just be able to do some variation (add
appropriate error checking) on the following:
$result=mysql_query("select foo as databasenumber from bar where
whatever='something'");
$row=mysql_fetch_array($result);
extract($row);
runprogram("hls",$databasenumber);
(If the objective really is to concatenate literal quote characters onto a
string, then the other poster already gave you a good solution.)
--
CC