Problem while inserting rows!!
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
if(!empty($country) and $country==229)
$q="select distinct us.StateCode from uscitystatezip us,country ct where us.country_id=ct.country_id and ct.country_str_long_name='united states of america' order by StateCode";
$ret=mysql_query($q, $con)or die(mysql_error());
//foreach($line as $value)
//print "<option value='$value'>$value</option>";
print "<option value='$line1'" ;
if ($line1 == $state)
echo "--Select State--";
Waiting 4 ur reply!