Jump to content

PHP in Table


manalnor

Recommended Posts

Hello dear friends,

 

i've made database table

 

if(isset($_POST[s1]))
{
$qeg = "update my_table set
code = '$_POST[code]' ";
$reg = mysql_query($qeg) or die(mysql_error());
echo 'done';
}

 

and get the stored text in my table

 

$qeg = "select * from my_table";
$reg = mysql_query($qeg) or die(mysql_error());
$aeg = mysql_fetch_array($reg);

 

and an form for it to post text

 

<form method=post>
code : <textarea id="code" name="code"><?=$aeg[code]?></textarea>

<input type=submit name="s1" value="Add"> 
</form>

 

now when i post

 

example :

<?php date("Y-m-d"); ?>

 

it should be stored but when i call it in an php file , it not appear

<?php
$qeg = "select * from my_table";
$reg = mysql_query($qeg) or die(mysql_error());
$aeg = mysql_fetch_array($reg);
?>

<?=$aeg[code]?>

 

why !!! can't store php code into mysql table

 

sorry for bad english , i mean

 

db table <--- store in it an php code

when i call it back it doesn't apprears

when i view page source it appears but not active as if plain text

as in the pink colored text can be seen in source but not active

 

b3ecc7288b8046ff88b6222.png

 

thank you

Link to comment
https://forums.phpfreaks.com/topic/227482-php-in-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.