heres मेरी कोड से जुड़ा हुआ:दूसरे से गिनती जहां आईडी के
$sql = mysql_query("select c.name, c.address, c.postcode, c.dob, c.mobile, c.email,
count(select * from bookings where b.id_customer = c.id) as purchased, count(select * from bookings where b.the_date > $now) as remaining,
from customers as c, bookings as b
where b.id_customer = c.id
order by c.name asc");
आप देख सकते हैं मुझे क्या करने की कोशिश कर रहा हूँ, लेकिन यकीन नहीं कैसे इस क्वेरी ठीक से लिखने के लिए im।
यहाँ त्रुटि मैं मिलता है:
चेतावनी: mysql_fetch_assoc(): आपूर्ति की तर्क एक वैध MySQL परिणाम संसाधन नहीं है
heres मेरी mysql_fetch_assoc:
<?php
while ($row = mysql_fetch_assoc($sql))
{
?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['mobile']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['purchased']; ?></td>
<td><?php echo $row['remaining']; ?></td>
</tr>
<?php
}
?>
क्या यह काम करता है जब phpmyadmin या सीएलआई इंटरफ़ेस से निष्पादित किया जाता है? –
कृपया दिखाएं कि आपने अपनी 'mysql_fetch_assoc() 'क्वेरी कैसे की। – stealthyninja
मैंने इसे मूल पोस्ट में जोड़ा ... – scarhand