snowman15 Posted October 25, 2007 Share Posted October 25, 2007 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>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/74786-mysql-small-error/ Share on other sites More sharing options...
Barand Posted October 25, 2007 Share Posted October 25, 2007 for each should be one word foreach (...) Quote Link to comment https://forums.phpfreaks.com/topic/74786-mysql-small-error/#findComment-378116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.