0
내 쿼리는 db에서 실행될 때 올바른 데이터를 반환하지만 live를 실행하면 company_title이 null로 돌아옵니다. 다른 모든 필드는 작동합니다. 당신의 일부 필드에 COALESCE
을 추가특정 열에 대한 결과가 없습니다. PHP/mysql
$query = "select * from invoices i, company_lookup cl, students s where i.company_id = cl.company_id and i.student_id = s.student_id;";
$results = $DB->query($query);
$invoices = mysql_query("select * from invoices");
?>
<table border="1" id="hl" name="hl">
<tr>
<th>Month/Year</th>
<th>Full Amount</th>
<th>Company</th>
</tr>
<?php while ($row = mysql_fetch_array($invoices)) {
$invoice_date = $row['invoice_date'];
?>
<tr onMouseOver="showInvoicePayments(<? echo $row['invoice_id'] ?>);this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor = '#FFFFFF'" bgcolor="#FFFFFF">
<td><? echo date('F Y',strtotime($invoice_date)) ?></td>
<td><? echo '$' . $row['full_amount'] ?></td>
<td><? echo $row['company_name'] ?></td>
</tr>
<?
}
?>
실생활과 개발자 머신의 데이터베이스가 동일합니까? – kirilloid
사용중인 테이블에 실제로 company_name 필드가 있습니까? PHP 배열 참조 ($ 행)에서 원하는 키를 사용할 수 있다고해서 실제로 MySQL의 해당 필드 결과가 있음을 의미하지는 않습니다. –
'$ invoices' 행에'$ query'가 아닌 행이 있기 때문에 @ini 결과가 나오기 때문에 @ini 결과가 나타납니다. $ results [ 'company_name'] ' – mgraph