Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php bluemix 500错误简易查询_Php_Mysql_Ibm Cloud - Fatal编程技术网

Php bluemix 500错误简易查询

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

我试图做一个简单的查询,从我的数据库中获取信息。当我启动浏览器时,我得到一个错误代码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 ($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这就是问题所在!这就是问题所在!