|
Posted by Tom on 05/10/07 17:23
"vinci" <vincentstudy@gmail.com> wrote in message
news:1169274824.032738.34640@v45g2000cwv.googlegroups.com...
> hi to all,
> i have one doubt. my mysql table name student..
> Fields name: StudName:nvarchar(20); Password: nvarchar(20);
> $sname=$_Post['StudName'];
> $pwd=$_Post['Password'];
> i try to this query.
>
> mysql query
>
> $result=mysql_query("select * from users where StudName=".$sname. "and
> password=".$pwd) or die(mysql_error());
>
>
> but this line not disply correct answer anybody pls help this.
>
>
> Regards,
> Vincent
>
Depending on the type of information you are trying to query, you normally
need to put the text string in single quotes, unless its a number. Similar
to...
select * from users where StudName='$sname' and password='$pwd';
Tom
--
Newsguy.com - Express Accounts - 30 GB $9.95 / month
Navigation:
[Reply to this message]
|