php - Can't list result from sql to html table -
trying list data mysql html table using php in main html file. i've been through of other questions on here , i'm sure have same methods , code them.
for reason (which suspect has mysql , not code) result blank table 1 row , 5 columns. each time try implement other codes seem print text onto site.
i'm confused think i've done right thing. i've been able list data mysql through php echo know it's there , can access it. appreciate on this. thank you.
<table border="1"> <tbody> <?php $connect = mysqli_connect("localhost", "daemon", "xampp", "test"); if (!$connect) { die(mysqli_error()); } $results = mysqli_query("select title,url,details,file,submission_date input"); while($row = mysqli_fetch_array($results)) { ?> <td><?php echo $row['title']?></td> <td><?php echo $row['url']?></td> <td><?php echo $row['details']?></td> <td><?php echo $row['file']?></td> <td><?php echo $row['submission_date']?></td> <?php } ?> </tbody> </table>
you code in mail html file? , printing out onto screen? try changing file .php not .html! php code won't run in .html file, , output code directly onto page.
Comments
Post a Comment