php - PHP MySQLi:变量问题
问题描述
我在 github 上找到了一位 T 恤设计师,并一直在努力。我设法让客户功能插入数据库,但它没有将订单详细信息发布到数据库中。我收到此错误:
注意:未定义变量:第 73 行 G:\xampp\htdocs\tdesigner\php\send.php 中的 selectNumRows
虽然当我检查第 73 行的代码时,我看不出它有任何问题。
功能代码:
/* Get the number of rows and current customer information */
if ($selectCurrentCustomer = $mysqli->prepare($querySelect)) {
/* Fetch the SELECT data */
$selectCurrentCustomer->execute();
$selectCurrentCustomer->bind_result($id);
$selectCurrentCustomer->store_result();
$selectCurrentCustomer->fetch();
/* Store the customer ID and number of rows found */
$selectNumRows = $selectCurrentCustomer->num_rows;
$customerId = (selectNumRows == 0) ? $id : null;
/* Close the query */
$selectCurrentCustomer->close();
}
/* If not a returning customer, insert them into the database. Otherwise, update the existing customer */
if ($selectNumRows == 0) { // LINE #73
我希望有人能在这方面帮助我。谢谢你。
解决方案
推荐阅读
- c# - EF Core 种子数据库 OneToMany 与预定义列表的关系
- python - Py2neo:如何正确使用 graph.run?
- scala - 对于 KeyedState,KeyBy None
- javascript - javascript游戏的重启按钮
- python - Python在列中将txt写入csv
- html - 基于高度和宽度的引导响应菜单
- javascript - 在 htm 烧瓶中启用或禁用从一页到另一页的按钮
- java - Bean 属性“dipartmantId”不可读或具有无效的 getter 方法:
- svg - 如何使用部分样式属性通过“select-by-selector”选择元素?
- rust - Rust cargo.toml 为 C 链接器和编译器指定自定义路径