|
Posted by Rami Elomaa on 05/21/07 07:34
"shotokan99" <soft_devjava@yahoo.com> wrote in message
news:1179731159.394388.318100@36g2000prm.googlegroups.com...
> hi,
>
> what is wrong with my statement
The whole concept.
> $sel="select username,password into '$user','$pass'
> from mytable where email = '$p' ";
> mysql_query($sel) or die ('error: cannot perform query');
> echo $user.' '.$pass;
>
> my objective is to assign values to the local variables taking from
> the table.
It don't work like that, into has a very different meaning.
> what is the proper way to do it?
Here's one way:
$sel="SELECT username, password FROM mytable WHERE email = '$p'";
$result = mysql_query($sel) or die ('error: cannot perform query');
list($user, $data) = mysql_fetch_array(result);
echo $user.' '.$pass;
--
Rami.Elomaa@gmail.com
"Good tea. Nice house." -- Worf
[Back to original message]
|