PDA

View Full Version : MM_Error:MySQL Error#


toleehua356796
07-06-2009, 09:26 AM
i am just insert the power store! but the images/thumb is not working!
the product detail & update page
Recordset(WADAProducts)
MM_Error:MySQL Error#; 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near “at line 2
The code is:
<?php
$ParamProductID_WADAProducts = "-1";
if (isset($_GET['ProductID'])) {
$ParamProductID_WADAProducts = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_localhost, $localhost);
$query_WADAProducts = sprintf("SELECT *, (ProductStock - (SELECT Coalesce(Sum(DetailQuantity),0) FROM orderdetails INNER JOIN orders ON OrderID = DetailOrderID WHERE DetailProductID = ProductID AND OrderDate > ProductUpdateDate)) AS NumLeft <<<<<<< SELECT *>>>>>>> FROM products WHERE ProductID = %s", GetSQLValueString($ParamProductID_WADAProducts, "int"));
$WADAProducts = mysql_query($query_WADAProducts, $localhost) or die(mysql_error());
$row_WADAProducts = mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts = mysql_num_rows($WADAProducts);

When i add the SELECT * ON THE NumLeft <<<< Here >>>>> The to fix the Recordset(WADAProducts)
MM_Error:MySQL Error#; When Error is fix. Not coming ! But the product detail & update page is not working. i try refresh mysql again. still the same.

So. Can you teach me how to fix this ?

Ray Borduin
07-06-2009, 09:37 AM
What version of mySQL do you have installed? It may not be a supported version since mySQL only started supporting nested SELECT statements in version 5 I believe.

toleehua356796
07-06-2009, 11:36 AM
[QUOTE=toleehua356796;8722]mysql

* Server version: 4.1.14
* Protocol version: 10
* Server: mysql via TCP/IP
* User: root123aaA@localhost
* MySQL charset: UTF-8 Unicode (utf8)
*
MySQL connection collation:
*
Create new database Documentation
* Show MySQL runtime information
* Show MySQL system variables Documentation
* Processes Documentation
* Character Sets and Collations
* Storage Engines
* Reload privileges Documentation
* Privileges
* Databases
* Export
* Import
* Log out

phpMyAdmin - 2.11.9

* MySQL client version: 3.23.49
* Used PHP extensions: mysql

Please toll me how to fix?

Ray Borduin
07-06-2009, 12:00 PM
Download and install the most recent version of mySQL or talk to your hosting provider about getting mySQL 5 installed you still are on mySQL 3.