我的 .php 页面出现语法错误
Im getting an syntax error on my .php page
我的其中一个 .php 页面出现语法错误。我在 mysql 中进行了查询并粘贴到我的 .php 页面中。当我尝试打开页面时,它给我一个语法错误。 "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 = %s
删除 book.price 后的逗号并将查询替换为
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"))
我的其中一个 .php 页面出现语法错误。我在 mysql 中进行了查询并粘贴到我的 .php 页面中。当我尝试打开页面时,它给我一个语法错误。 "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 = %s
删除 book.price 后的逗号并将查询替换为
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"))