Hi expertzz!!
1) I m new in PHP and Mysql. I m facing sum problems. i have make simple form in which i m inserting row in my mysql database. but the problems is, it's also storing dublicate rows, means same row are inserting in databse table 2 to 3 times while refreshing page. Now i want to check dublicate rows should not enter in database!!
2) I have make combo box which is dynamically bounded and refreshing it while selecting value(means Country combo displays related States and State displays related City) but when combo box refreshed values entered by User in above Textboxes,than values are not there means it refreshing whole page due to which values are not stored!! what will i do to Restore value while refreshing combo box. My code is
<?php
if(!empty($country) and $country==229)
{
$q="select distinct us.StateCode from uscitystatezip us,country ct where us.countryid=ct.countryid and ct.countrystrlongname='united states of america' order by StateCode";
$ret=mysqlquery($q, $con)or die(mysqlerror());
echo "<select name=state class=font10 onChange='javascript:document.form3.submit()'>"; //Refreshing here
while($line1=mysqlfetch_row($ret))
{
echo "$line1[0]";
//foreach($line as $value)
//{
//print "<option value='$value'>$value</option>";
print "<option value='$line1[0]'" ;
if (!empty($state))
{
if ($line1[0] == $state)
{
print "selected";
}
}
print">$line1[0]</option>";
}
// }
print "</select>";
}
else
{
echo "--Select State--";
}
?>
Waiting 4 ur reply!
Thnxx
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).