I need dropdown menu with this options, just each of them have to show data from base where is = location

<p>Mesna zajednica 
<select name="mesto">
<option value="donji_grad">Donji Grad</option>
<option value="karadjordjev_dud">Karadjordjev Dud</option>
<option value="plavinac">Plavinac</option>
<option value="seone">Seone</option>
<option value="ladna_voda">Ladna Voda</option>
<option value="lestar">Lestar</option>
<option value="zlatno_brdo">Zlatno Brdo</option>
<option value="slavija">Slavija</option>
<option value="papazovac">Papazovac</option>
<option value="carina">Carina</option>
<option value="sveti_sava">Sveti Sava</option>
<option value="25maj">25. Maj</option>
<option value="udovice">Udovice</option>
<option value="lipe">Lipe</option>
<option value="mihajlovac">Mihajlovac</option>
<option value="vranovo">Vranovo</option>
<option value="radinac">Radinac</option>
<option value="mala_krsna">Mala Krsna</option>
<option value="skobalj">Skobalj</option>
<option value="osipaonica">Osipaonica</option>
<option value="drugovac">Drugovac</option>
<option value="badljevica">Badljevica</option>
<option value="salinac">Salinac</option>
<option value="kulic">Kulic</option>
<option value="suvodol">Suvodol</option>
<option value="lunjevac">Lunjevac</option>
<option value="landol">Landol</option>
<option value="petrijevo">Petrijevo</option>
<option value="kolari">Kolari</option>
<option value="binovac">Binovac</option>
<option value="lugavcina">Lugavcina</option>
<option value="saraorci">Saraorci</option>
<option value="vucak">Vucak</option>
<option value="vrbovac">Vrbovac</option>
<option value="ralja">Ralja</option>
<option value="dobri_do">Dobri Do</option>
<option value="vodanj">Vodanj</option>
<option value="malo_orasje">Malo Orasje</option>
</select></p>

each location need to show something like this

<html>
	<head><title>Anketa</title></head>
	<body>






<?
$username="a4764180_anketa";
$password="a12345";
$database="a4764180_anketa";

mysql_connect("mysql6.000webhost.com",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM anketa";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

echo "<b><center>Statistika</center></b><br><br>";

$i=0;
while ($i < $num) {

$mesto=mysql_result($result,$i,"mesto");
$ime=mysql_result($result,$i,"ime");
$broj_clanova=mysql_result($result,$i,"broj_clanova");
$clanova_sa_pravom_glasa=mysql_result($result,$i,"clanova_sa_pravom_glasa");
$adresa=mysql_result($result,$i,"adresa");
$broj_zaposlenih=mysql_result($result,$i,"broj_zaposlenih");
$broj_nezaposlenih=mysql_result($result,$i,"broj_nezaposlenih");
$broj_penzionera=mysql_result($result,$i,"broj_penzionera");
$clan_stranke=mysql_result($result,$i,"clan_stranke");
$glavni_problem=mysql_result($result,$i,"glavni_problem");
$predlog_resenja=mysql_result($result,$i,"predlog_resenja");
$spredni_problemi=mysql_result($result,$i,"sporedni_problemi");
$predlog_resenja2=mysql_result($result,$i,"predlog_resenja2");
$politicar=mysql_result($result,$i,"politicar");
$sps=mysql_result($result,$i,"sps");
$razlog=mysql_result($result,$i,"razlog");
$ako_ne=mysql_result($result,$i,"ako_ne");



echo "<p>Mesto: $mesto</p> <p>Broj clanova domacinstva: $broj_clanova</p> <p>Broj clanova sa pravom glasa: $clanova_sa_pravom_glasa</p> <p>Broj zaposlenih u domacinstvu: $broj_zaposlenih</p> <p>Broj nezaposlenih: $broj_nezaposlenih</p> <p>Broj penzionera clanova u domacinstvu: $broj_penzionera<p>";

$i++;
}

?>

just each location will have this $query="SELECT * FROM anketa"; with WHERE is mesto = location chosed from dropdown menu

and I need code to make checkboxes = votes to count as 1 I have names and each name have checkbox so when I show that in statistic I need to show like name = 23 votes for example

then make a checkbox for vote, after that add new field for table anketa, named it "votes"data type int default 0, then every submission increment it by one, you can do it my having this query = "UPDATE anketa SET votes=votes+1 WHERE location='your_location'"

I need to transfer checkboxes to votes but I also have to store that name who get votes, also I need to make them count in total for each location, and I need some numbers from families to count same way

bump!

Member Avatar for iamthwee

Bumping won't help...

You state a lot of things that you need... Great, what ideas do you have to code that? Or were you expecting someone to come along and post the code. This is your project... Show us some of your ideas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.