Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.