0
<?php
$con = mysql_connect('localhost', 'root', 'pass');
if(!$con){
echo "Error connection";
}
$select_db = mysql_select_db('mydatabase', $con);
if(!$select_db){
echo "Error to select database";
}
mysql_set_charset("utf8", $con);
$result = mysql_query("select count(1) FROM Credit WHERE CreditStatusID=6");
$row = mysql_fetch_array($result);
$total = $row[0]-1;
echo "<font size='6px' color='#000000'>Total: </font><font size='6px' color='#FF0000'><b>" . $total . "</b></font>";
mysql_close($con);
?>
我需要得到一些其他信息,例如WHERE CreditStatusID=6 AND CreditStatus=7,8,9,..
,但它不起作用。你能解釋我怎樣才能以另一種方式做到這一點?選擇多個ID
我試過這種方式,但沒有結果: $ result = mysql_query(「select count(1)FROM Credit WHERE CreditStatusID = 6 AND CreditStatus in(1,2,3)」); – Levan 2014-10-29 07:26:16
沒有結果請幫忙:( – Levan 2014-10-29 07:31:32
請問您可以粘貼您的表格內容嗎? – SMA 2014-10-29 07:33:27