我在.php页面上遇到语法错误(Im getting an syntax error on my .php page)

编程入门 行业动态 更新时间:2024-10-24 10:17:21
我在.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 = %s

You 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

更多推荐

本文发布于:2023-07-08 20:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1080291.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我在   语法错误   页面   php   page

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!