heni_pro 0 Newbie Poster

the command used for this purpose is.
mysql_query("UPDATE tbl set field='$value' WHERE id='$id'");

thank you for this but i've the person table with an attributes of firstname,id and ratingno. if u hit the same person,the rating should be increased by one without using another row for the same person. I mean to tell like this...

heni_pro 0 Newbie Poster

how can i display the next row data of the same zone by looping?...

heni_pro 0 Newbie Poster

i'm just having a prblem with displaying records from db in the same page. i'm just trying to write a php code but it didn't show up. Th records are documnted in db by thier first name, middlename & party.
html:

<[B]select name="zone" size="1" id="zone"[/B]>
<option selected="selected" value="Addis Zone1">Addis Zone1</option>
<option value="Addis Zone2>Addis Zone2</option>
<option value="Addis Zone3>Addis Zone3</option>
<option value="Addis Zone4>Addis Zone4</option>
<option value="Addis Zone5>Addis Zone5</option>
</select>
        </label>

      </span></p>

                                       <div align="center">
                              <input name="first" type="radio" checked value="first" />


                                                  <span class="style12">First Name</span>
                              [B]<input type="text" name="firstname" size="20" />[/B]
                                                  <span class="style12">Second Name</span>
                             [B] <input type="text" name="secondname" size="20" />[/B]
                                                  <span class="style2">Party Status
                                                 [B] <input type="text" name="party" size="20" />[/B]
        </span>
                                                  </div>

if it's like this i wrote the php code also but it didn't work for me.

<?php
if ($zone == "zone")
{
$result=mysql_query("select zone,firstname,middlename,party from candidate where $zone='$_POST[zone]'") or
die (mysql_error());
while ($row=mysql_fetch_array($result))
{
echo '$firstname='$row[firstname]';
echo '$firstname='$row[firstname]';
echo '$party='$row[party]';

}
else
exit;
}

plzz check it out..

heni_pro 0 Newbie Poster

Try this one
<?
//connection
mysql_connect(localhost,root,vertrigo)or die("Error while conneciton");
//select the database
mysql_select_db("$db") or die(mysql_error());
?>

if u using the vertrigo server. Or u can post ur code.

heni_pro 0 Newbie Poster

I'm having a problem in displaying data from the table.I've a candidate table in the db. i 've got the problem when i try to select the place of the candidate in the main html code. the html has the place selector, frist name, middle name and partystatus of it. when i try to select the place it should retrive from the db table. and displays the names and party status. i wrote the php code to track this

if ($place == "zone")
{
$w=0;
$result=mysql_query("select first name,middlename, party from candidate") or
die (mysql_error());
//$row=mysql_fetch_array($result);
while ($row=mysql_fetch_array($result))
{

echo' $first name:$row["firstname"] 
        $middlename: $row["midddlename"]
        $party: $row["party"]
}

i wrote it like this but it has a problem, i want it to count and find the place and the row.. check it for me...

heni_pro 0 Newbie Poster

i mean to say that there's a selection box which have region values. so, whenever the region value is selected, the zone selection values from that region value has to come in the zone selection from the database. i tried that code and it didn't select from the database. i was writing that if the region is selected it must retrive its zone values of the database. this is what i mean...

heni_pro 0 Newbie Poster
if($region==region){

$result = mysql_query("SELECT * FROM places");
$row = mysql_fetch_assoc($result);
 
echo "zone: ".$row['zone'].";
}
heni_pro 0 Newbie Poster

i've anothe question, in here. I've made a registration form which 've region and zone with selection type. Main thing is wheni select the region, the zone list must come out as selection method from the DB. i've got the problem in php codes... help me outt...

heni_pro 0 Newbie Poster

i'm doing php project on e-voting and i've a data goes from voters in the databse can u help me to give me the php code that counts the votes in voting seesion and display the result..plzzzzz