Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2005, 12:03 AM
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to raman1
Default Problem while inserting rows!!

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.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());
echo "<select name=state class=font10 onChange='javascript:document.form3.submit()'>"; //Refreshing here
while($line1=mysql_fetch_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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting multiple rows from datagrid to database ashish0512 ASP.NET 1.x and 2.0 Application Design 2 August 25th, 2012 02:09 AM
Automatically inserting rows at varied intervals Peskarik Excel VBA 0 August 14th, 2008 02:24 AM
Gridview and inserting rows thewoodchuck BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 0 April 10th, 2008 09:55 AM
Passing and Inserting mutliple rows at once SQLScott SQL Server 2005 4 February 12th, 2007 11:10 AM
creating a table and inserting rows. sasidhar79 Classic ASP Databases 2 July 28th, 2004 03:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.