Give me feedback

Data Display Table

I wish to display the data from database in table form as it is in database using PHP and MYSQL. The code I used wasn't working like that; some should help me.

viewprasise.php
/** * Add your code here * Any language, just go for it. */<?php include_once('../index/connection.php'); $conn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT praises_Id, fname, dob, baptismaldate, house, telephone, comment FROM praises'; mysql_select_db('praises'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "PRAISES ID :{$row['praises_Id']} <br> ". "FULL NAME : {$row['fname']} <br> ". "DATE OF BIRTH : {$row['dob']} <br> ". "BAPTISMAL DATE : {$row['baptismaldate']} <br> ". "HOUSE LOCATION : {$row['house']} <br>". "TELEPHONE : {$row['telephone']} <br> ". "COMMENT : {$row['comment']} <br>". "--------------------------------<br>"; } mysql_close($conn); ?>
viewprasise.php
/** * Add your code here * Any language, just go for it. */<?php include_once('../index/connection.php'); $conn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT praises_Id, fname, dob, baptismaldate, house, telephone, comment FROM praises'; mysql_select_db('praises'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "PRAISES ID :{$row['praises_Id']} <br> ". "FULL NAME : {$row['fname']} <br> ". "DATE OF BIRTH : {$row['dob']} <br> ". "BAPTISMAL DATE : {$row['baptismaldate']} <br> ". "HOUSE LOCATION : {$row['house']} <br>". "TELEPHONE : {$row['telephone']} <br> ". "COMMENT : {$row['comment']} <br>". "--------------------------------<br>"; } mysql_close($conn); ?>

Reactions 0 reactions

No reactions yet, be the first: comment or tweak the code

Comment on this code:

Please Login or Register to leave a comment.