co.ador Posted February 17, 2010 Share Posted February 17, 2010 The error is coming from this line 21 LEFT OUTER JOIN dkb ON ( cart.id = dkb.id and dkb.id = $is ) line 21 Error: #1064 - 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 'FROM cart LEFT OUTER JOIN dkb ON (cart.id = dkb.i' at line 21 The error below is being generated by the Run SQL query/queries. $is= isset($_GET['is'])?(int) $_GET['is']:null; $ic= isset($_GET['is'])?(int) $_GET['is']:null; $result = mysql_query("SELECT cart.id AS cart_id, cart.qty AS qty, dkb.id As dkb_id, dkb.price AS price1, dkb.name As name1, cdkb.id As cdkb_id, cdkb.price AS price2, dkb.name As name2, dbl.id As dbl_id FROM cart LEFT OUTER JOIN dkb ON ( cart.id = dkb.id and dkb.id = $is ) LEFT OUTER JOIN dbl ON ( dbl.id = dkb.id ) LEFT OUTER JOIN cdkb on ( cart.id = cdkb.id and cdkb.id = $ic ) WHERE cart.id = '" . GetCartId() . "'ORDER BY dkb.name AND cdkb.name ASC" ); <?php $totalCost=0; while($row = mysql_fetch_array($result)) { // Increment the total cost of all items $totalCost += ($row["qty"] * $row["price1"]);?> <select name="<?php echo $row["dkb_id"]; ?>" onChange="UpdateQty(this)"> <?php echo $row["name1"]; ?></p></div> Link to comment https://forums.phpfreaks.com/topic/192336-i-have-an-problem-with-a-query/ Share on other sites More sharing options...
dpacmittal Posted February 17, 2010 Share Posted February 17, 2010 The error is coming from this line 21 LEFT OUTER JOIN dkb ON ( cart.id = dkb.id and dkb.id = $is ) line 21 Error: #1064 - 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 'FROM cart LEFT OUTER JOIN dkb ON (cart.id = dkb.i' at line 21 Runs fine through phpmyadmin? Link to comment https://forums.phpfreaks.com/topic/192336-i-have-an-problem-with-a-query/#findComment-1013529 Share on other sites More sharing options...
co.ador Posted February 17, 2010 Author Share Posted February 17, 2010 That's the error below and not that's what phpmyadmin is throwing back... #1064 - 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 'FROM cart LEFT OUTER JOIN dkb ON (cart.id = dkb.i' at line 21 Link to comment https://forums.phpfreaks.com/topic/192336-i-have-an-problem-with-a-query/#findComment-1013530 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.