Your top priority should be to replace all those antiquated and soon to be removed mysql_ calls with their mysqli_ or PDO equivalents (as you should have started doing at least five years ago).
I found Solution. I imported table in to the function price_table(); // after I saved function in to the database but don’t save dynamic table , only save function name … (price_table() not saved <table>contains</table>
<?php
function writeMsg(){
@mysql_connect("localhost","root","") or die('connection error');
mysql_query('SET NAMES \'utf8\'');
mysql_select_db('gas') or die('Can not connect to the database');
$result = mysql_query('SELECT * FROM `wp_farsc`');
if($result && mysql_num_rows ($result)> 0){
echo '<table border="2px" cellspacing="5px" width="100%">'.PHP_EOL;
echo '<tr bgcolor="yellow"><th>سکه</th><th>قیمت انلاین</th><th>تغییر قیمت</th><th>کمترین</th><th>بیشترین</th><th>زمان بروز رسانی</th></tr>'.PHP_EOL;
while($row = mysql_fetch_assoc($result)){
echo'<tr>';
echo '<td>'.$row ['titile'].'</td>';
echo '<td>'.$row ['liveprice'].'</td>';
echo '<td>'.$row ['changing'].'</td>';
echo '<td>'.$row ['lowest'].'</td>';
echo '<td>'.$row ['topest'].'</td>';
echo '<td>'.$row ['time'].'</td>';
echo'</tr>'.PHP_EOL;
}
}
mysql_close();
@mysql_connect("localhost","root","") or die('connection error');
mysql_select_db('gas') or die('Can not connect to the database');
mysql_query("set names utf8");
$title ="عنوان مطلب امروز";
$content ="echo writemsg();";
$statuse="Publish";
$pingo="open";
$commento="open";
$typee="post";
$auther="1";
$sql = "INSERT INTO `wp_posts`( post_author,post_title,post_content,post_status,post_type,ping_status,comment_status) VALUES('$auther','$title','$content','$statuse','$typee','$pingo','$commento')";
mysql_query($sql);
mysql_close();
?>
EDIT
This post has been reformatted by enclosing the code block in 3 backticks
```
on their own lines.