Php 内部联接:注意:显示未定义的索引
我有两个表Php 内部联接:注意:显示未定义的索引,php,mysql,inner-join,Php,Mysql,Inner Join,我有两个表temp\u bid和post\u project。我想记录谁的项目投标。为此,我使用内部联接进行了一个查询,但得到了未定义的索引错误。它在MySQL编辑器中工作 这是我的密码 <?php include 'conn.php'; session_start(); if ($_SESSION['EmailID'] == "") { header("location:index.html"); } $getTempBid = "SELECT * from temp_bid
temp\u bid
和post\u project
。我想记录谁的项目投标。为此,我使用内部联接进行了一个查询,但得到了未定义的索引错误。它在MySQL编辑器中工作
这是我的密码
<?php
include 'conn.php';
session_start();
if ($_SESSION['EmailID'] == "") {
header("location:index.html");
}
$getTempBid = "SELECT * from temp_bid TB INNER JOIN post_project P ON P._id = TB.prj_id " +
" WHERE TB.bidBy = '" .$_SESSION['EmailID']."'";
$tempBidResult = mysqli_query($conn,$getTempBid);
while($fetchTempBid = mysqli_fetch_row($tempBidResult)) {
$tempBidId = $fetchTempBid['tempBidId'];
$tempBidPrjId = $fetchTempBid['prj_id'];
$tempBidPostBy = $fetchTempBid['postBy'];
$tempBidBy = $fetchTempBid['bidBy'];
$tempBidOn = new DateTime($fetchTempBid['bidOn']);
$tempBidAmount = $fetchTempBid['amount'];
$tempBidDays = $fetchTempBid['days'];
$tempBidProposalDetails = $fetchTempBid['proposalDetails'];
$tempBidStatus = $fetchTempBid['bidStatus'];
$prjId = $fetchTempBid['_id'];
$prjTitle = $fetchTempBid['projectTitle'];
$prjDescriptions = $fetchTempBid['projectDescriptions'];
$prjSkills = $fetchTempBid['projectRequiredSkill'];
$prjSkills1 = explode(",", $prjSkills);
$prjBudget = $fetchTempBid['projectBudget'];
$prjPostDate = new DateTime($fetchTempBid['projectCreatedOn']);
$prjStatus = $fetchTempBid['projectStatus'];
}
$records = mysqli_num_rows($tempBidResult);
?>
mysqli\u fetch\u行
返回带有数字键的数组。从:
从结果集中获取一行数据,并将其作为枚举数组返回,其中每列存储在从0(零)开始的数组偏移量中。随后对该函数的每次调用都将返回结果集中的下一行,如果没有更多行,则返回NULL
改为使用返回一个以列名为键的数组。这只是意味着查询不返回任何记录。请尝试直接在mysql中使用完全相同的值
$\u SESSION['EmailID']
运行查询,并检查是否有记录出现?@AlivetoDie,我已经直接在mysql中使用完全相同的值$\u SESSION['EmailID']
运行了相同的查询,并且有记录出现。下面是正确的答案
Notice: Undefined index: tempBidId in C:\wamp\www\Gopinath Infosystem\testpage.php on line 23
Notice: Undefined index: prj_id in C:\wamp\www\xxx\testpage.php on line 24
Notice: Undefined index: postBy in C:\wamp\www\xxx\testpage.php on line 25
Notice: Undefined index: bidBy in C:\wamp\www\xxx\testpage.php on line 26
Notice: Undefined index: bidOn in C:\wamp\www\xxx\testpage.php on line 27
Notice: Undefined index: amount in C:\wamp\www\xxx\testpage.php on line 28
Notice: Undefined index: days in C:\wamp\www\xxx\testpage.php on line 29