发新话题
打印

还是菜鸟求助,编码的问题。。谢谢。。。。。。。。

本主题由 admin 于 2007-11-4 12:02 移动

还是菜鸟求助,编码的问题。。谢谢。。。。。。。。

是这样的,我编写了下面几个文件。分别是:write.html   save.php    index.php

write.html主要代码是:

<form name="form1" method="post" action="save.php">
请输入新闻题目:<input type=text name="newsname" width=50><br><br>
<textarea name="content" cols=50 rows=50></textarea><br><br>
<input type="submit" value="提交">

save.php 运行正常,主要是将数据插入到数据库。代码略。

出错的是index.php
index.php主要代码是:

<?php

$con=mysql_connect("localhost","root","");
mysql_select_db("xr",$con);
$sqlselect="slect * from xrwire 0,5";
$rs=mysql_query($sqlselect,$con);
$myrow=mysql_fetch_array($rs);   //出错了。。。

$newsname=$_POST['newsname'];   //出错了。。。
$content=$_POST['content'];     //出错了。。。

。。。下面的代码省略了,因为到这里出错了。。。

错误有三:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\php\htdocs\index.php on line 15

Notice: Undefined index: newsname in e:\php\htdocs\index.php on line 17

Notice: Undefined index: content in e:\php\htdocs\index.php on line 18

搞不明白为什么错了,求高手指点!感激不尽!!!

TOP

发新话题