crazyben21 Posted August 31, 2009 Share Posted August 31, 2009 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. Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/ Share on other sites More sharing options...
crazyben21 Posted August 31, 2009 Author Share Posted August 31, 2009 So Has anybody found an issue with code or not? Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/#findComment-909680 Share on other sites More sharing options...
crazyben21 Posted September 1, 2009 Author Share Posted September 1, 2009 somebody say anything. Any idea. yes or no? Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/#findComment-910006 Share on other sites More sharing options...
crazyben21 Posted September 1, 2009 Author Share Posted September 1, 2009 bump! Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/#findComment-910419 Share on other sites More sharing options...
crazyben21 Posted September 1, 2009 Author Share Posted September 1, 2009 Thank you guys. I found another forum that replied to me. Even telling me they don't see nothing wrong with my code. That it could be a problem with apache, php, or mysql. Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/#findComment-910597 Share on other sites More sharing options...
crazyben21 Posted September 2, 2009 Author Share Posted September 2, 2009 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. Link to comment https://forums.phpfreaks.com/topic/172529-solved-php-while-loop-cause-the-connection-was-reset/#findComment-910651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.