RE: [PHP] Parsing database variables
- From: linux@xxxxxxxxxxxxxxxxx ("Jake McHenry")
- Date: Fri, 30 Mar 2007 17:06:50 -0400
thought about that, I would need to do one ereg for each variable then
correct? as of right now, there are 0 variables in the first field, and 17
in the second... so it would be 17 ereg replaces... then if i add or change
anything, possibly more...
This will work, but was hoping for an easier way...
Jake
_____
From: Daniel Brown [mailto:parasane@xxxxxxxxx]
Sent: Friday, March 30, 2007 5:02 PM
To: Jake McHenry
Subject: Re: [PHP] Parsing database variables
Jake, could you use ereg_replace() to do that?
<?
//....
while($row = mysql_fetch_array($result)) {
$html = ereg_replace("$"."name",$name,$row['column_name'];
}
I split the first field of the ereg_replace() input so that it wouldn't
be read by the function as a variable.
On 3/30/07, Jake McHenry <HYPERLINK
"mailto:linux@xxxxxxxxxxxxxxxxx"linux@xxxxxxxxxxxxxxxxx> wrote:
Sorry.. Typos... But that's not the point... I looked the function... Dunno
how I missed it.... Thanks... Do you know if eval() has any size limitations
to it? The database fields are about a page each....
Thanks,
Jake
-----Original Message-----"mailto:jblanchard@xxxxxxxxxx"jblanchard@xxxxxxxxxx]
From: Jay Blanchard [mailto: HYPERLINK
Sent: Friday, March 30, 2007 4:50 PM"mailto:php-general@xxxxxxxxxxxxx"php-general@xxxxxxxxxxxxx
To: Jake McHenry; HYPERLINK
Subject: RE: [PHP] Parsing database variables
[snip]
I have a database table with this in it:
<p>$name<p>
Period Ending Date: $ppe<p>
Etc.......
And in my script, these variables exist and have values. Is
there a way
for
me to get the output from mysql_query to use the current script
variables in
place of the same variable name within the database output?
[/snip]
a. Bad HTML, always use a closing tag like </p>
b. Check HYPERLINK "http://www.php.net/eval"http://www.php.net/eval
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.23/740 - Release
Date: 3/30/2007 1:15 PM
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.23/740 - Release Date: 3/30/2007
1:15 PM
--
PHP General Mailing List (HYPERLINK
"http://www.php.net/"http://www.php.net/)
To unsubscribe, visit: HYPERLINK
"http://www.php.net/unsub.php"http://www.php.net/unsub.php
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.23/740 - Release Date: 3/30/2007
1:15 PM
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.23/740 - Release Date: 3/30/2007
1:15 PM
- Follow-Ups:
- Re: [PHP] Parsing database variables
- From: Myron Turner
- Re: [PHP] Parsing database variables
- Prev by Date: RE: [PHP] Parsing database variables
- Next by Date: Re: [PHP] Parsing database variables
- Previous by thread: Parsing database variables
- Next by thread: Re: [PHP] Parsing database variables
- Index(es):
Relevant Pages
|