Re: While not working

From: Date: Fri, 20 Apr 2001 07:03:09 +0000
Subject: Re: While not working
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-6907@lists.php.net to get a copy of this message
you have a colon instead of a semi colon. (:,;) also, if u continue having problems, use mysql_fetch_row instead of mysql_fetch_array mike ""Danilo Meles"" <dmeles@paraisonet.com.br> wrote in message news:001801c0c8fd$3e9272c0$23cecac8@BLUE... > Hy There; > > I'm trying to get a string from one table in my db. I'm using while to get > get this data. But it's not working: > > Please see the following code , In the while tag I'm trying to get the > USER_ID from my table, but it returns zero instead. > What I'm doing wrong??? > > Thanks for a while !! > > Danilo Meles > > <? > //conexão com o Banco > include ("db.php"); > //Selecao do db > mysql_select_db("$DB") or die("Db não encontrado"); > //Querys do programa > $quser= "SELECT id_User, login, senha FROM user Where login ='$usuario'"; > > $qinsuser = "insert into user (login, senha) values ('$usuario', '$senha')"; > > $qbaseuser = "INSERT INTO AddressUser (Id_AddUser, UrlUser, IndiceUser) > SELECT Id_User, Url, Indice FROM address"; > > $qveruser = "SELECT id_User, login, senha FROM user Where login = > '$usuario'"; > > $qupuser = "UPDATE AddressUser SET Id_AddUser = '$id' WHERE Id_AddUser > ='5'"; > > //verificação da caixa postal > $mbox = @imap_open ("{paraisonet.com.br:143}INBOX", "$usuario", > "$senha"); > if (!$mbox): > echo "Ooopsss !!!<br><br> Por favor se você é assinante da ParaisoNet, tente > novamente. <br><br> Caso contrário clique aqui."; > exit; > endif; > // pesquisa se usuario existe > $queryuser = mysql_query("$quser")or die("a pesquisa de usuario falhou"); > $Num = mysql_num_rows($queryuser); > if (!$Num): > //inserção de novo usuario > $queryinsuser = mysql_query("$qinsuser")or die("a inserção falhou falhou"); > // copia de registros de uma tabela para outra > $querybaseuser = mysql_query("$qbaseuser")or die("a inserçao da base > falhou"); > > // here is the while command. But the $id variable get zero (0) , and it > should get the ID_USER from my db. What I'm doing wrong?? > while ($dados = mysql_fetch_array($queryuser)): > $id = $dados[id_User]; > endwhile; > > > // atualização do id do usuario > $queryupsuser = mysql_query("$qupuser")or die("A atualização falhou"); > if ($queryupsuser): > echo "deu ceto"; > echo "$id foda"; > else: > echo "deu errado"; > endif; > else: > echo "usuario existente "; > endif; > > ?> > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.windows (#6907) next »