PHP script just stops for no reason

PHP script just stops for no reason

am 30.08.2007 09:09:15 von Luis Carlos

Hi everybody.
Even if I'm not a professional, I've been coding PHP for some years
now. However, I can not "see" any error in this very simple script and
it does not continues executing after the 'while'.

My script is:






echo "

START...

";

require_once 'variables.php'; /* All the variables*/
require_once '.htinfo.php'; /* db info */

$sql = "SELECT * FROM $table_name ORDER BY 'uid'";
$result = @mysql_query($sql,$connection) or die(mysql_error());

while ($row = mysql_fetch_assoc($result) OR die(mysql_error())) {
foreach($row as $key => $value) {
if ($key != 'uid' && $key != 'nombre') {
$estadisticas[$key][$value]++ ;
} /* closes if */
} /* closes foreach*/
} /*closes while*/

echo "

END...

";
?>




I know the array $estadisticas is being updated ok, but, nothing I
place after the while is closed is executed.

To make things even simpler, I just wanted the script to print "END",
and nothing happens.

If I look at the code of the generate page, I get:





START...




So, not even the remaining html tags are written in the displayed
page.

Any help will be appreciated, I can not just see anything wrong in
this trivial script.

I tested the script on Mandriva Linux and in Windows XP (xampp), same
results.

Re: PHP script just stops for no reason

am 30.08.2007 09:52:57 von p.lepin

Luis Carlos wrote in
<1188457755.344967.250750@w3g2000hsg.googlegroups.com>:
> >
> echo "

START...

";
>
> require_once 'variables.php'; /* All the variables*/
> require_once '.htinfo.php'; /* db info */
>
> $sql = "SELECT * FROM $table_name ORDER BY 'uid'";
> $result = @mysql_query($sql,$connection) or
> die(mysql_error());
>
> while ($row = mysql_fetch_assoc($result) OR
> die(mysql_error())) {

Gee. Guess what happens after you've processed all the rows
in the resultset?

> I know the array $estadisticas is being updated ok, but,
> nothing I place after the while is closed is executed.

You asked for it.

--
This chickenus crossed the roadus while yodelingus.

Re: PHP script just stops for no reason

am 30.08.2007 13:37:19 von Luis Carlos

On 30 ago, 01:52, Pavel Lepin wrote:

> > while ($row = mysql_fetch_assoc($result) OR
> > die(mysql_error())) {
>
> Gee. Guess what happens after you've processed all the rows
> in the resultset?


Oh God. Script was suddenly *dying* and I could no figure out where :-
$

Thank you very much!