douhua1760 2013-01-05 06:12
浏览 46
已采纳

将textarea数据显示到mysql中

I'm using XAMPP, phpmyadmin and even after correcting it so many times, in output it only shows updated records. The data is not being inserted somehow.

<?php 

$name=$_POST['comment']; 
$link=mysql_connect('localhost', 'root','' ); 
mysql_select_db('comments',$link);
mysql_query("insert into comment values('$name'"); 
echo '<script type="text/javascript"> 

<!-- window.location = "display1.php" --> </script>'; 

?>

display1.php

<?php 

$link=mysql_connect('localhost', 'root','' ); 
mysql_select_db('comments',$link); 
echo "Updated records:<br>"; 

$result=mysql_query("select * from comment"); 

while($row=mysql_fetch_array($result)) {
    $tempname=$row['commenting']; echo $tempname."<br>";
}

?>
  • 写回答

2条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 C# 循环读写数据中途突然变慢
      • ¥100 CVI2012 做暗通道图像去雾思路详细步骤
      • ¥15 用Java实现双端队列
      • ¥150 ID3决策树实现分类
      • ¥15 multisim10安装后,找不到NI License Manager的程序来安装许可证
      • ¥15 C++银行卡系统 Help!
      • ¥15 R语言数据分析的相关问题
      • ¥15 模型导入SP后贴图纹理只有一个,拆了四张UV的,怎么解决?
      • ¥15 检索带order by 非常慢
      • ¥20 python 爬虫 token 加密方式