我正在尝试使用PHP和MYSQL从数据库中读取一些数据并且fitch功能不起作用它不读取任何内容可以请帮助这里是我的php文件
<html>
<body>
<?php
$dbhost="127.0.0.1";
$dbuser="root";
$dbpass="";
$dbname="mss";
$connection=mysql_connect($dbhost,$dbuser,$dbpass,$dbname);
if(mysql_errno()){
die("Database Connection failed:" . mysql_error() . "(" . mysql_errno() .")");
}
?>
<?php $id = (isset($_POST['id']) ? $_POST['id']: "hello"); ?> <br>
<?php $title = (isset($_POST['title']) ? $_POST['title']: "hello"); ?><br>
<?php $employee = (isset($_POST['employee']) ? $_POST['employee']: "hello"); ?><br>
<?php $participant = (isset($_POST['participant']) ? $_POST['participant']: "hello");
$starttime = (isset($_POST['starttime']) ? $_POST['starttime']: "hello");
$endtime = (isset($_POST['endtime']) ? $_POST['endtime']: "hello");
$day = (isset($_POST['day']) ? $_POST['day']: "hello");
$Lines = explode("\n", $participant);
foreach($Lines as $line)
{ echo $line;
mysql_select_db('mss');
$q1="select Availability from E_schedule where Employee_name='$line' and StartTime='$starttime' and Day='$day'";
if($q1 === FALSE) {
die(mysql_error());
}
$result = mysql_query( $q1, $connection );
echo $result;
$info=mysql_fetch_array($result);
echo $info['Availability'];
if (! $result)
die (mysql_error());
}
?>
<br>
<?php $day = (isset($_POST['day']) ? $_POST['day']: "hello"); ?>
<br>
<?php $starttime = (isset($_POST['starttime']) ? $_POST['starttime']: "hello"); ?>
<br>
<?php $endtime = (isset($_POST['endtime']) ? $_POST['endtime']: "hello"); ?>
<br>
<?php $room = (isset($_POST['room']) ? $_POST['room']: "hello"); ?> <br>
</body>
</html>
我不知道我哪里做错了,结果看起来像这样 dbrown资源ID#4pravi资源ID#5资源ID#6 在此先感谢您的帮助