On Sep 16, 2012 4:33 PM, "El Ale..." <alexissauc...@gmail.com> wrote:
>
> hi! im new in this forum, i not speak very good english, apologise im
> spanish.
> I have a problem, need one infinit bucle to mysql only "true" if "false"
> break this, for example:

    Que paso, Alex?

    La lista de PHP en espanol es aqui:

        http://php.net/mailinglists

    Lo siento para me espanol.

> prueba.php:
>
> <?
> include("conexion.php");
>
> do {
>
>
> echo "$numero";
> sleep(1);
>
>
> if ($numero == 1)
> reset;
>         continue;
>     break;
> } while (true);
>
> ?>
>
> ############################################################3
>
> connect to mysql
>
> conexion.php:
>
> <?
>
> $conexion = mysql_connect("localhost", "alexis", "123456");
>             mysql_select_db("probando", $conexion);
> $queEmp = "SELECT n FROM numero WHERE n LIKE 1";
> $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
> $totEmp = mysql_num_rows($resEmp);
> if ($totEmp> 0) {
>      while ($rowEmp = mysql_fetch_assoc($resEmp)) {
>      $numero = $rowEmp['n'];
>
> }
> echo "$numero";
> }
> mysql_close($conexion);
> ?>
>
> What I do is to run the loop as long as the value "$ number" is equal to
> "1" in mysql I have a single field called "n" with the value "1" and runs,
> now the problem is the next, I run the loop with the value "1" in mysql
and
> it runs fine but when I go to mysql and change the value to "2" (which
> would be an incorrect and should leave) the loop ignores him and continues
> running, I was reading a lot about the loops but I can not make it work in
> this way could you please give me a hand with this? or if I'm wrong What
> else I can do an infinite command if it fulfills a function and if they do
> not?.
>
> Best regards

Reply via email to