Hack Forums
[PHP] Any Reason my Read-DB Code Doesn't Display Actual Values? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] Any Reason my Read-DB Code Doesn't Display Actual Values? (/showthread.php?tid=5933731)



Any Reason my Read-DB Code Doesn't Display Actual Values? - Effexion - Jan 25, 2019

PHP Code

<?php 
  
<div class="container" style="position: center; margin-left: 800px">
 
  <div class="col-xs-6">
 
   <?php 
      
     $con 
= mysqli_connect('localhost', 'root', '', 'loginapp');
 
    $query = "SELECT * FROM users";
 
    $result = mysqli_query($con, $query);
 
    
     
if(!$result) {
 
        echo "WE JUST CAN'T DO IT, SCOTTY";
 
    }
 
   
    else
{
 
        while($row=mysqli_fetch_row($result)) {
 
              print_r($result);
 
          }
 
   
}
 
         
       
       ?>
    </div>
    </div> 

Quote:Spoiler (Click to View)




RE: Any Reason my Read-DB Code Doesn't Display Actual Values? - Squito - Jan 25, 2019

PHP Code

<?php 
while($row=mysqli_fetch_assoc($result)) {
               
print_r($row);
           } 



RE: Any Reason my Read-DB Code Doesn't Display Actual Values? - Effexion - Jan 25, 2019

(Jan 25, 2019 05:20 AM)Squito Wrote:  
PHP Code

<?php 
while($row=mysqli_fetch_assoc($result)) {
 
              print_r($row);
 
          } 

I'm an idiot haha. Thanks a lot, Squito.