Jump to content

MySQL small error


snowman15

Recommended Posts

Cant figure out this error but I'm pretty sure there is one, its not outputting anything...

 

 

<?php
  
  // (1) Open the database connection and select the "winestore" schema
   @ $db = new mysqli('itins3.matcmadison.edu', 'XXXXX', 'XXXXXX', 'winestore');
   if (mysqli_connect_errno()) {
     echo 'Error: Could not connect to the database winestore at this time.<br>';
     exit;
   }

   // (2) Run the query on the winestore through the connection
   $result = $db->query("SELECT * FROM winery");
   
   // (3) While there are still rows in the result set, fetch the current
   // row into the array $row
   while ($row = $result->fetch_assoc())
   {
     // (4) Print out each element in $row, that is, print the values of
     // the columns
      for each ($row as $column)
         print "{$column} ";

      // Print a carriage return to format the output
      print "<br>";
   }
?>

Link to comment
https://forums.phpfreaks.com/topic/74786-mysql-small-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.