1
The code below gives error, it does not add the results of $row
, only the comma and the dot. What to do?
Code that doesn’t work
mysql_select_db('cadastro',$conexao);
$sql="select * from usuario";
$resultado = mysql_query($sql) or die ("Erro: " . mysql_error());
// Obtém o resultado de uma linha como um objeto
while($row = mysql_fetch_array($resultado))
$variavel=($row['email'].",".$row['senha']."^") ;
// quero que tudo isso que esta entre () vire uma $variavel
echo $variavel
?>
Code that feels right
<?php
@$conexao = mysql_connect('localhost','root','');
mysql_select_db('cadastro',$conexao);
$sql="select * from usuario";
$resultado = mysql_query($sql) or die ("Erro: " . mysql_error());
// Obtém o resultado de uma linha como um objeto
while($row = mysql_fetch_array($resultado))
echo $row['email'].",".$row['senha']."";
echo "^";
?>
That’s the code, so the result that it appears to me is EXAMPLE: [email protected],123456,^
email and password are in my database what I want is that all this echo, this result turn a variable
Check that the field names (email and password) are correct.
– rray
making
echo $row['email'];
andecho $row['senha'];
values are printed correctly?– feresjorge
Yes appear EXAMPLE: [email protected],123456, Ai I need this result to turn into a variable
– Victor Mansolelli
do you just want to print this variable? do you want it to become an array?
– rray
I want you to concatenate the email and password in a variable for example [email protected],123456,^
– Victor Mansolelli