RE: [PHP] Parsing database variables



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-----
From: Jay Blanchard [mailto: HYPERLINK
"mailto:jblanchard@xxxxxxxxxx"jblanchard@xxxxxxxxxx]
Sent: Friday, March 30, 2007 4:50 PM
To: Jake McHenry; HYPERLINK
"mailto:php-general@xxxxxxxxxxxxx"php-general@xxxxxxxxxxxxx
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



Relevant Pages

  • [F8] Local fedora bug reporting system woes?
    ... Subject: Cron /usr/sbin/moodle-cron ... No virus found in this incoming message. ... Checked by AVG Free Edition. ...
    (Fedora)
  • Re: Multiple Subchannel Set Usage
    ... make sure the bases defined as 3390B and the aliases defined as ... No virus found in this outgoing message. ... Checked by AVG Free Edition. ... No virus found in this incoming message. ...
    (bit.listserv.ibm-main)
  • RE: Problem with DBI::Multiplex
    ... No virus found in this incoming message. ... Checked by AVG Free Edition. ... No virus found in this outgoing message. ...
    (perl.dbi.users)
  • Re: [PHP] Alternative/Addition to using a CAPTCHA
    ... Hmm, just wanted to say that Jake, is it because i have my resolution ... >> No virus found in this incoming message. ... >> Checked by AVG Free Edition. ...
    (php.general)
  • RE: [PHP] Cannot send a hyperlink
    ... No virus found in this incoming message. ... Checked by AVG Free Edition. ... Cannot send a hyperlink ...
    (php.general)