Hii, я пытаюсь запустить таблицу mysql на localhost с PHP и получаю эту ошибку.
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in C:\wamp64\www\database\mydb.php on line 25
Что я уже пробовал:
<?php echo "<!DOCTYPE html>"; echo "<html>"; echo "<head>"; echo "<title> Psychiatric disorders database </title>"; echo "<style>"; echo "<table align='center' border='1px' width:'600px' line-height:'40px;'>"; echo "</style>"; echo "</head>"; echo "<body>"; $servername = "localhost"; $username = "root"; $password = ""; $dbname = "mydb"; include("connection.php"); $sql = "SELECT Accession ID, Title, Abstract, Sample size, Tissue type, PMID, Platform ID, Platform details, Raw data FROM schizophrenia raw datasets "; $result = mysqli_query($conn, $sql); { // output data of each row while($row = mysqli_fetch_assoc($result)) echo "<table><tr><th> Accession ID </th><th>Title</th> <th> Abstract </th><th> Sample size </th><th> Tissue type </th><th> PMID </th><th> Platform ID </th><th> Platform details </th><th> Raw data </th></tr>"; } echo "<tr><td>", $row['Accession ID'], "</td><td>", $row['Title'], "</td><td>", $row['Abstract'], "</td><td>",$row['Sample size'], "</td><td>",$row['Tissue type'], "</td><td>",$row['PMID'], "</td><td>",$row['Platform ID'], "</td><td>",$row['Platform details'], "</td><td>",$row['Raw data'],"</td></tr>"; echo "</table>"; //$conn->close(); //</body>; //</html>; ?>