Reply to Re: select count with rows

Your name:

Reply:


Posted by Floor on 11/22/05 17:07

Replace echo "$result"; with something like

while ($dnn = mysql_fetch_array($result)
{
echo ("$dnn[0] $dnn[1]");
}

will do the trick

Floor

Op Mon, 21 Nov 2005 13:40:13 +0100 schreef Wendy Hoovens
<spam@studioo.be>:

>Hello everybody!
>
>I'n new to PHP, did an Access course, but this is quite new. I'm not
>planning todo alot of programming in the future but I like to finish
>things, so here I go :)
>
> From another script i took the date code to put this in a variable for
>the select statement.
>
>Unfortuneatly it does'nt give me the result, a row with the amount of
>magazines per location.
>
>After some googling this has probably something todo with fetch_rows but
> I can't figure it out myself :(
>
>Thannks alot for the advice and sorry for my bad English :)
>
>Greetings, Wendy
>
><HTML>
><HEAD><TITLE>Overzicht films</TITLE></HEAD>
><BODY>
><h1 align=center>Overzicht</h1>
><?
>require ('connect.inc');
>?>
>
><form method=post>
>Begindatum:
><select name=dag1>
><?
>$i=0;
>while ($i<31){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select>
><select name=maand1>
><?
>$i=0;
>while ($i<12){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select>
><select name=jaar1>
><?
>$i=2004;
>while ($i<2007){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select><br>
>
>Einddatum
><select name=dag2>
><?
>$i=0;
>while ($i<31){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select>
><select name=maand2>
><?
>$i=0;
>while ($i<12){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select>
><select name=jaar2>
><?
>$i=2004;
>while ($i<2007){
>$i++;
>echo "<option value=$i>$i</option>";
>}
>?>
></select>
><input type=submit value=opvragen>
><input type=hidden value=1 name=opgevraagd>
></form>
>
><?
>
>$start="$_POST[jaar1]"."-"."$_POST[maand1]"."-"."$_POST[dag1]";
>$eind="$_POST[jaar2]"."-"."$_POST[maand2]"."-"."$_POST[dag2]";
>?>
><hr>
><?
>$result = mysql_query("SELECT location, COUNT(type) FROM bib WHERE type
>=\"magazine\" AND datum>=\"$start\" AND datum<=\"$eind\" GROUP BY locatie");
>echo "$result";
>?>
></BODY>
></HTML>

[Back to original 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

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