我在.php页面上遇到语法错误(Im getting an syntax error on my .php page)
我在我的一个.php页面上遇到语法错误。 我在mysql中进行了查询并粘贴在我的.php页面中。 当我尝试打开页面时,它给我一个语法错误。 “来自trolly.idbook = book.idbook上的trolly内部连接书附近的语法错误,其中trolly.purchase'àlaligne 1”
mysql_select_db($database_databaseConnection, $databaseConnection); $query_BookPurchase = sprintf("Select book.name, book.price, From trolly inner join book on trolly.idbook = book.idbook where trolly.purchaseok = %s and trolly.id = %s", GetSQLValueString($varTrolly_BookPurchase, "int"),GetSQLValueString($varUser_BookPurchase, "int")); $BookPurchase = mysql_query($query_BookPurchase, $databaseConnection) or die(mysql_error()); $row_BookPurchase = mysql_fetch_assoc($BookPurchase); $totalRows_BookPurchase = mysql_num_rows($BookPurchase); ?>Im getting an syntax error on one of my .php pages. I have made an query in mysql and pasted in my .php page. when i do try to open the page its giving me an syntax error. "Syntax error near 'From trolly inner join book on trolly.idbook = book.idbook where trolly.purchase' à la ligne 1"
mysql_select_db($database_databaseConnection, $databaseConnection); $query_BookPurchase = sprintf("Select book.name, book.price, From trolly inner join book on trolly.idbook = book.idbook where trolly.purchaseok = %s and trolly.id = %s", GetSQLValueString($varTrolly_BookPurchase, "int"),GetSQLValueString($varUser_BookPurchase, "int")); $BookPurchase = mysql_query($query_BookPurchase, $databaseConnection) or die(mysql_error()); $row_BookPurchase = mysql_fetch_assoc($BookPurchase); $totalRows_BookPurchase = mysql_num_rows($BookPurchase); ?>最满意答案
你在book.price之后有一个逗号。 去掉它。
Select book.name, book.price From trolly inner join book on trolly.idbook = book.idbook where trolly.purchaseok = %s and trolly.id = %sYou have a comma after book.price. Remove it.
Select book.name, book.price From trolly inner join book on trolly.idbook = book.idbook where trolly.purchaseok = %s and trolly.id = %s更多推荐
发布评论