0
데이터베이스에서 찾은 모든 항목을 표시하는 PHP를 완료했습니다. ! ! WAMP 에서하지만 XAMPP와 skul에서 열 때 ..xampp에서 오류가 있지만 wamp가 없습니다.
Warning: mysql_num_rows() expects parameter 1 to be resource
나는 문제가 무엇인지 잘 모릅니다 ,.
$connect = mysql_connect('localhost','root','') or die(mysql_error());
$select = mysql_select_db('mis_library',$connect) or die(mysql_error());
$result=mysql_query('SELECT book FROM Catalog') or die(mysql_error());;
$total=mysql_num_rows($result); <<<<<<<<<<<<<<<THIS PART! ! ! ! ! !
echo "<div style=font-family:calibri;font-size:20px;font-weight:bold;>There are $total Available Entries.</div><br />";
echo "<div style=font-family:calibri;font-size:15px;font-weight:bold;margin-top:-10px;>Select some from the following. . .</div><br />";
echo "<div style=overflow-y:auto;overflow-x:hidden;height:210px; >";
$i=0;
while ($row=mysql_fetch_row($result))
{
foreach ($row as $field)
$get=mysql_query("SELECT b_total, b_os FROM catalog WHERE book='$field'");
$view=mysql_fetch_array($get);
$i++;
echo "
<form id='Entry_view' action='Entry_view.php' method='get' target='area_right' >
<input type='hidden' id='input$i' name='Entry_view_get' value='$field' />
<a href='' onClick='submit();standout();' >
<div id='div' style=background:url('Background/Transparent_8.png')no-repeat;background-size:350px;width:450px;height:30px;float:left;margin-left:5px;margin-top:5px;border-radius:3px;>
<div style='font-family:calibri;padding-left:5px;padding-top:3px;float:left;size:8px;color:darkgreen;font-weight:bold;margin-top:0px;margin-left:0;border:groove;border-radius:3px;width:340px;height:21px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;'>
$field
</div>
</a>
<div style='font-family:calibri; font-size:10px; color:darkgreen; height:25px; font-weight:bold;float:left;margin:2px 0px 0px 2px;' >
Total Books: ".$view[b_total]." <br />Books on Shelf: ".$view[b_os]."
</div>
</div>
</form>
";
}
echo "</div>";
내 div 및 양식을 신경 쓰지 마세요 .it는 추가 기능에 대한 세부 정보였습니다.
문제에 대한 해결책을 찾았습니까? – Mike