need help error sql
master,
i have a problem with my homework,
have an error like this :
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order o, detail_order d, member m, buku b WHERE o.id_order=d.id_' at line 5"
this my script :
<?php
$GIDOrder=$_SESSION['id_order'];
$DataStatus=array("baru","lunas","terkirim");
$QOrder=mysql_query("SELECT o.id_order, o.tanggal, o.status,
d.jumlah,
b.isbn, b.judul, b.harga,
m.nama, m.alamat, m.Kota
FROM order o, detail_order d, member m, buku b
WHERE
o.id_order=d.id_order
AND m.id_member=o.id_member
AND level='member'
AND d.isbn=b.isbn
AND o.id_order='".$GIDOrder."'
") OR DIE(mysql_error());
if(mysql_num_rows($QOrder)){
echo "<table align='center' width='610'>
<tr bgcolor='#d8dfea'><th colspan='6'>Informasi Produk</th></tr>
<tr bgcolor='#92a751'><th>No</th><th>ISBN</th><th>Buku</th><th>Harga</th><th>Jml</th><th>Subtotal</th>
</tr>";
$Tot=0;
$No=1;
while($r=mysql_fetch_array($QOrder)){
$IDOrder=$r['id_order'];
$TglOrder=$r['tanggal'];
$StatusOrder=$r['status'];
$JmlBeli=$r['jumlah'];
$ISBN=$r['isbn'];
$Harga=$r['harga'];
$Judul=$r['judul'];
$NamaLengkap=$r['nama'];
$Alamat=$r['alamat'];
$Kota=$r['kota'];
$SubTotal=$Harga*$JmlBeli;
$Tot=$Tot+$SubTotal;
if($No % 2==0){
echo "<tr bgcolor='#d8dfea'>";
}
else {
echo "<tr bgcolor='#edeff4'>";
}
echo "<td>$No</td><td>$ISBN</td><td>$Judul</td><td>Rp ".number_format($Harga,2,",",".")."</td><td>$JmlBeli</td><td align='right'>Rp ".number_format
($SubTotal,2,",",".")."</td></tr>";
$No++;
}
echo "<tr bgcolor='#92a751'><th colspan='4' align='right'>Total</th><th colspan='2' align='right'>Rp ".number_format($Tot,2,",",".")."</th></tr>";
echo "<tr><td colspan='6' height='20'> </td></tr>
<tr bgcolor='#d8dfea'><th colspan='6'>Informasi Pembeli</th></tr>
<tr bgcolor='#edeff4'><td colspan='3'>ID Order</td><td colspan='3'>$IDOrder</td></tr>
<tr bgcolor='#d8dfea'><td colspan='3'>Tanggal</td><td colspan='3'>$TglOrder</td></tr>
<tr bgcolor='#edeff4'><td colspan='3'>Nama</td><td colspan='3'>$NamaLengkap</td></tr>
<tr bgcolor='#edeff4'><td colspan='3'>Kota</td><td colspan='3'>$Kota</td></tr>
<tr bgcolor='#d8dfea'><td colspan='3'>Alamat</td><td colspan='3'>$Alamat</td></tr>
<tr bgcolor='#edeff4'><td colspan='3'>Status</td><td colspan='3'>
<form action='$_SERVER[PHP_SELF]?page=order&act=proses' method='POST'>
<input type='hidden' name='id_order' value='$IDOrder'>
";
foreach($DataStatus AS $Key=>$Val){
if($StatusOrder==$Val){
echo "".strtoupper($Val)."";
}
}
echo "</td></tr>
</table>
";
}
else
{
echo '<meta http-equiv="refresh" content="0;url=index.php">';
exit;
}
?>
please help master
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks