php-windows | 2001042
Date: 04/19/01
- Next message: Phil Driscoll: "Re: [PHP-WIN] PHP4 on Win problem"
- Previous message: GArlington: "[PHP-WIN] PHP4 on Win problem"
- Next in thread: MD: "Re: [PHP-WIN] While not working"
- Reply: MD: "Re: [PHP-WIN] While not working"
- Reply: Johannes Janson: "Re: [PHP-WIN] While not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 = <email protected> ("{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 <email protected> For additional commands, e-mail: php-windows-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Phil Driscoll: "Re: [PHP-WIN] PHP4 on Win problem"
- Previous message: GArlington: "[PHP-WIN] PHP4 on Win problem"
- Next in thread: MD: "Re: [PHP-WIN] While not working"
- Reply: MD: "Re: [PHP-WIN] While not working"
- Reply: Johannes Janson: "Re: [PHP-WIN] While not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

