+ -
当前位置:首页 → 问答吧 → 求助,,为什么我的php操纵不了MySQL额...  (还是不行,,,)

求助,,为什么我的php操纵不了MySQL额...  (还是不行,,,)

时间:2010-10-09

来源:互联网

<?php
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * FROM message";
 $query=mysql_query($sql);
 while($row=mysql_fetch_array($query)){
?>
  <tr bgcolor="#eff3ff">
  <td>标题:<?=$row[title]?> 用户: <?=$row[user]?></td>
  </tr>
  <tr bgColor="#ffffff">
  <td>内容:<?=$row[content]?> </td>
  </tr>
  <?
 }
  ?>
</table>



OR DIE没提示连接错误,,应该是连接成功了

然后这个表显示的内容为空,,是没读到数据



这个是为什么呢.........


[ 此帖被idoljay在2010-10-09 02:09重新编辑 ]

作者: idoljay   发布时间: 2010-10-09

试试吧,要加上字段的。
复制代码
  1. INSERT INTO `bbs`.`bbs1` (`id`, `uid`, `title`, `content`, `date`) VALUES (NULL, 'daw', 'dawf', 'fawdg', now());
[ 此帖被zxdsu在2010-10-09 01:17重新编辑 ]

作者: zxdsu   发布时间: 2010-10-09

zxdsu 你好

试过了额,,


后来我试了发现,, user和title是carchar型,
content是tinytext型,,user和title可以任意
但是当content为中文是,无法保存数据

为其他时,可以保存数据,,,这是为什么呢....
郁闷.....


作者: idoljay   发布时间: 2010-10-09

问题依旧,,读不到数据...

作者: idoljay   发布时间: 2010-10-09