You are here: Re: While data geting from mysql error « PHP SQL « IT news, forums, messages
Re: While data geting from mysql error

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]


Удаленная работа для программистов  •  Как заработать на 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

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