I have a following question. I have put a long text (variable type LONGTEXT) into MYSQL database - through command line. Somewhere in this text there's a <br>
tag, and near the end of text there's <?php phpinfo(); ?>
. If i type SELECT * FROM mytable WHERE id=1
, this whole text shows as it is, so it is unaltered (read: both <br>
AND <?php phpinfo(); ?>
are there. But when I submit query via php like this:
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_row($result)) {
echo $row[1];
}
}
Then the text is displayed exactly as I want it on my webpage, that means that <br>
tag is processed by the browser as newline, AND <?php phpinfo(); ?>
part is IGNORED. That is actually exactly what I want. But my question IS: WHY doesn't <?php phpinfo(); ?>
part get processed via browser?? Does the PHP's echo function ignore the <?php
tag??
Thanks in advance for explanations.