You are here: Re: problem with select count(*) « PHP Programming Language « IT news, forums, messages
Re: problem with select count(*)

Posted by Kimmo Laine on 12/19/05 14:12

"Ben" <sdvs@qcsq> wrote in message
news:M8ednbrca5ajADveRVnygQ@scarlet.biz...
> Hi,
>
> I have a problem with this query:
>
>
> $link = mysql_connect("localhost", "root", "pw");
> $dbsel = mysql_select_db('mydb', $link);
> $lol='bibi';
>
> $sql = "select count(*) as totuur from studres where where dag>= curdate()
> AND logon='" . $lol . "'";


You have WHERE twice in "...from studres where where dag...", try what
happens if you remove the extra where. This is one of the reasons why sql
keywords should be written in CAPITAL letters. It's easier to spot the error
if you write:
"SELECT COUNT(*) AS totuur FROM studres WHERE WHERE dag>= CURDATE() AND
logon='$lol'"

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация