Jump to content

[SOLVED] PHP while loop cause "The connection was reset"


crazyben21

Recommended Posts

Hello again I'm back. In my php code together with mysqli, it's causing firefox to show "The connection was reset" error. The problem starts in the while loop in my code. Can't manage to find what I'm doing wrong wrong or what I'm missing.

 

<?php
//sql connecting

$iscon = mysqli_connect('localhost','root','password');
if(!$iscon)
{
die('Could not connect to mySQL: ' . mysqli_connect_errno($iscon) . '<br/>' . mysqli_connect_error($iscon) . '<br/>');
}


?>

<?php

if ( !mysqli_select_db($iscon,'juniblog') )
{
echo 'Database doesn\'t excist: ' . mysqli_error($iscon) . '<br/>';
echo "Creating new database....<br/>";
if( mysqli_query($iscon, 'CREATE DATABASE juniblog') )
echo 'Database has been created successfully..';
else
echo die('An error has occured creating database: ' . mysqli_error($iscon));
}
else
echo "Database excist and is selected.";
?>


<?php 
$junitable = mysqli_query($iscon, "select * from messageblog");

echo "Hello Milena!<br/>";

while($row = mysqli_fetch_array($junitable))
{
echo "<div style=\"border:thin black solid\">";

echo '<p>' . 'Titlte:' . $row['title'] . '</p>';
echo '<p>' . 'Message:' . $row['postmessage'] . '</p>';
echo '<p>' . 'Author:' . $row['author'] . '</p>';
echo '<p>' . 'Date:' . $row['date'] . '</p>';

echo "</div>";
}


?>


<?php mysqli_close($iscon); ?>

 

This the part that cause the problem:

while($row = mysqli_fetch_array($junitable))
{
echo "<div style=\"border:thin black solid\">";

echo '<p>' . 'Titlte:' . $row['title'] . '</p>';
echo '<p>' . 'Message:' . $row['postmessage'] . '</p>';
echo '<p>' . 'Author:' . $row['author'] . '</p>';
echo '<p>' . 'Date:' . $row['date'] . '</p>';

echo "</div>";
}

 

Just a Note: I created the table, with all the attributes, with MySql Query Browser.

I solve my "Page Can't be display" problem when I remove apavhe64 and php64bit and installed 32bit apache and php. Last time I'm using unofficial 64bit php and apache from http://www.elxis.org/guides/developers-guides/64bit-apache-php-mysql-windows.html. Now The thing I'm running is MySqL 64bit Official from mysql website.

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.