You are here: Re: error on sql in php code « PHP Programming Language « IT news, forums, messages
Re: error on sql in php code

Posted by Jerry Stuckle on 08/09/07 20:37

nfantis wrote:
> On Aug 9, 7:31 am, upendra...@gmail.com wrote:
>> Dear friends,
>>
>> I am running the code
>> $check_1 = mysql_query("SELECT * FROM user WHERE u_name = '".
>> $_POST['username']."'") or die(mysql_error());
>>
>
> Its probably your SQL statement. You aren't ending it with a
> semicolon.
>
> Use this: $check_1 = mysql_query("SELECT * FROM user WHERE u_name =
> '" .
> $_POST['username']"';") or die
> mysql_error();
>
> Notice the semicolon right after the single colon before the
> parenthesis.
>

A semicolon isn't required when calling MySQL via a function in PHP (or
C, for that matter).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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