kurole Posted February 19, 2005 Report Share Posted February 19, 2005 Como eu faço para pegar todos os registros através da extract..??pela while eu sei fazer !<? require_once 'mysql.php';$SQL = "SELECT * FROM products";$db = mysql_query($SQL,$conexao);$res = mysql_fetch_array($db);extract($res,EXTR_PREFIX_ALL, "p");echo $p_nome."<br>";?>KUROLE Quote Link to comment Share on other sites More sharing options...
0 Error404 Posted February 19, 2005 Report Share Posted February 19, 2005 Pela lógica esse scripts deveria funcionar.O que acontece? Não mostra nada? Quote Link to comment Share on other sites More sharing options...
0 kurole Posted February 19, 2005 Author Report Share Posted February 19, 2005 Ele esta mostrando apenas 1 registro........KUROLE Quote Link to comment Share on other sites More sharing options...
0 Error404 Posted February 19, 2005 Report Share Posted February 19, 2005 Mas é isso aí mesmo.A mysql_fetch_array() retorna só 1 linha dos resultados e move o ponteiro pra próxima. Por isso se usa o while(), pra que ele vá puxando as linhas enquanto houverem linhas.Entendeu? Quote Link to comment Share on other sites More sharing options...
0 kurole Posted February 19, 2005 Author Report Share Posted February 19, 2005 Certo.... valeu..KUROLE... Quote Link to comment Share on other sites More sharing options...
Question
kurole
Como eu faço para pegar todos os registros através da extract..??
pela while eu sei fazer !
KUROLE
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.