Hercles Posted May 20, 2014 at 11:03 AM Report #556349 Posted May 20, 2014 at 11:03 AM Caros, o Mysql_fetch_row => recuperação de linhas na tabelas e Mysql_num_fields => processamento de atributos. Algum exemplo prático para que eu possa entender a utilização?
guarana1 Posted May 20, 2014 at 11:23 AM Report #556352 Posted May 20, 2014 at 11:23 AM Mysql_fetch_row <?php $result = mysql_query("SELECT id,email FROM people WHERE id = '42'"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } $row = mysql_fetch_row($result); echo $row[0]; // 42 echo $row[1]; // the email value ?> Mysql_num_fields <?php $result = mysql_query("SELECT id,email FROM people WHERE id = '42'"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } /* returns 2 because id,email === two fields */ echo mysql_num_fields($result); ?>
Hercles Posted May 20, 2014 at 11:28 AM Author Report #556355 Posted May 20, 2014 at 11:28 AM nesta linha $result = mysql_query("SELECT id,email FROM people WHERE id = '42'"); é opcional colocar a variável de conexão depois do '42', $conexao"?
guarana1 Posted May 20, 2014 at 11:36 AM Report #556357 Posted May 20, 2014 at 11:36 AM (edited) Como assim? Edited May 20, 2014 at 11:37 AM by guarana1
Hercles Posted May 20, 2014 at 11:49 AM Author Report #556361 Posted May 20, 2014 at 11:49 AM eu digo, não tem que conectar o script ao BD? isso já acontece automaticamente?
I-NOZex Posted May 20, 2014 at 11:52 AM Report #556364 Posted May 20, 2014 at 11:52 AM volto a dizer, troca isso por mysqli B2R » Beat2Revolution v3.0b | Regista e divulga-nos beat2revolution.net
Hercles Posted May 20, 2014 at 11:59 AM Author Report #556368 Posted May 20, 2014 at 11:59 AM I-NOZex kkkkkk lembrei da nossa conversa. Então é opcional em outras versões?
I-NOZex Posted May 20, 2014 at 12:06 PM Report #556375 Posted May 20, 2014 at 12:06 PM é opcional, caso apenas utilizes um link, uma ligaçao a uma base de dados se usares multiplas bd's, ja nao é opcional... http://www.php.net/manual/pt_BR/book.mysqli.php B2R » Beat2Revolution v3.0b | Regista e divulga-nos beat2revolution.net
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now