Php bluemix 500错误简易查询
我试图做一个简单的查询,从我的数据库中获取信息。当我启动浏览器时,我得到一个错误代码500。我不明白为什么。我正在使用bluemix devOps。这是我的代码:Php bluemix 500错误简易查询,php,mysql,ibm-cloud,Php,Mysql,Ibm Cloud,我试图做一个简单的查询,从我的数据库中获取信息。当我启动浏览器时,我得到一个错误代码500。我不明白为什么。我正在使用bluemix devOps。这是我的代码: <?php include 'db.php';?> <?php //Query to get information from the database $strsql = "SELECT name, technology, problem FROM idea WHERE status='saved'"; if
<?php include 'db.php';?>
<?php
//Query to get information from the database
$strsql = "SELECT name, technology, problem FROM idea WHERE status='saved'";
if ($result = $mysqli->query($strsql)) {
} else {
echo "<b>Can't query the database;
}
?>
<?php
echo "<tr>\n";
while ($property = mysqli_fetch_field($result)) {
echo '<th>' . $property->name . "</th>\n"; //the headings
}
echo "</tr>\n";
mysqli_data_seek ( $result, 0 );
if($result->num_rows == 0){ //nothing in the table
echo '<td>Empty!</td>';
}
while ( $row = mysqli_fetch_row ( $result ) ) {
echo "<tr>\n";
for($i = 0; $i < mysqli_num_fields ( $result ); $i ++) {
echo '<td>' . "$row[$i]" . '</td>';
}
echo "</tr>\n";
}
$result->close();
mysqli_close();
?>
您的代码中有一个错误
echo "<b>Can't query the database;
echo”无法查询数据库;
关闭时缺少双蓝引号您的代码中有错误
echo "<b>Can't query the database;
echo”无法查询数据库;
关闭时缺少doblue报价Thx这就是问题所在!这就是问题所在!