Hi,
I wonder if you can help me please.
I’ve purchased a copy if Kevin’s “Build your own database driven web site using php and mysql” (an excellent book) but I do seem to be having some trouble with running a “While” clause.
On page 143 of the book, Kevin describes the following while clause :-
while ($row = mysqli_fetch_array($result))
{
$jokes = array(‘id’ => $row[‘id’], ‘text’ => $row[‘joketext’]);
}
Whenever I try to execute this my browser just “hangs”. I can comment out the while loop and everything runs as expected.
If I comment out the $jokes assignment and substitue in a basic assignment ( $count=0; ) the browser still “hangs” which is leading me to think that the
$row = mysqli_fetch_array($result)
statement is causing the issue.
All other scripting examples up until this point have worked flawlessly.
I am currently running :
mysqladmin Ver 8.42 Distrib 5.1.43, for Win32 on ia32
php-5.2.12-Win32
IE8: version 8.0.7600.16385
and I have 5 rows in my joke database (inserted using the insertjoke routine).
I have checked the book’s Errata web page - no joy.
Any advice would be greatly appreciated.
Thanks,
Chris.