Vote count:
0
i was trying to print out the list total of items by sql.i works well on phpmyadmin..i dont know what is wrong with my sql..anyone can help me?
mysql_select_db($database_dbcon, $dbcon);
$query_Recordset1 = **"USE `most`; SELECT `item_name`, SUM(`stock_invent`) AS `Total Items` FROM inventories GROUP BY `item_name`"**;
$Recordset1 = mysql_query($query_Recordset1, $dbcon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
i got this kind of messages : "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 'SELECT item_name, SUM(stock_invent) AS Total Items FROM inventories GROUP ' at line 1"
asked 16 secs ago
SQL Error : USE `most`; SELECT `item_name`, SUM(`stock_invent`) AS `Total Items` FROM inventories GROUP BY `item_name
Aucun commentaire:
Enregistrer un commentaire