You are here: Re: select into statement not working..help pls « PHP Programming Language « IT news, forums, messages
Re: select into statement not working..help pls

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация