答案 0 :(得分:3)
确保首先在Powershell会话中设置了正确的环境变量。
<?php
session_start();
include'database.php';
$ssmain = $_SESSION['sessionsmain'];
$conn = mysqli_connect($server, $dbusername, $dbpassword, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT * FROM employee where E_ID = '$ssmain' || LastName like '%$ssmain' || FirstName like '%$ssmain'";
$no=0;
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) { ?>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Last Name</th>
<th>First Name</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_assoc($result)) {
$no++;
?>
<tr>
<td><a href="employeerecord.php"><?php $_SESSION['ttid'] = $row['E_ID']; echo"{$row['E_ID']}"; ?></a></td>
<td><?php echo"{$row['FirstName']}"; ?></td>
<td><?php echo"{$row['LastName']}"; ?></td>
</tr>
<?php
}
}
else
{
header('location: error404.php');
}
?>
</tbody>
</table>
替换&#39; FB.api('/me', function(response) {
console.log(response);
});
&#39;用你的机器名称。