Posts

Showing posts from October, 2018

How to display content of mysql table to php page | AkshayBSoputions

1.Create database with name ProjectDb in mysql. 2. Create table accounts. 3. Write following code to your editor. <?php $con=mysqli_connect("localhost","root","","ProjectDb"); ?> <html> <head> <style type="text/css"> table{ width:50%; margin-left:25%; } </style> </head> <body> <table border="1"> <tr> <th>UN</th> <th>EMAIL</TH> <th>CONTACT</th> </tr> <?php $query="select * from accounts"; $i=0; $result=mysqli_query($con,$query); while($row=mysqli_fetch_assoc($result)){ if($i%2==0){ ?> <tr> <td><?php echo $row['UN'] ?></td> <td><?php echo $row['EMAIL'] ?></td> <td><?php echo $row['CONTACT'] ?></td> </tr> <?php }else{ ?> <tr bgcolor="gray"> <td><?php echo $...