| | |
combobox problems
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
new to this php..
i have a login page.
<form name="form" id="form" action="aa.php" method="post">
...
<input name="txtusername" id="txtusername" type="text" width="70px" class="style23"/>
<input name="txtpass" type="password" width="70px" class="style23"/>
...... button here...
</form>
after login i am getting login name of user form URl ->http://localhost/MIS/PS/add/add_ps2.php?name=champawat.in second page i hva three combobox(unit,achivements,crop).the data they containing fetch form mysql on the basis of login name entered. i am fetching unit form mysql below code....
<?php
$d=$_GET['loginname'];
$res = mysql_query("SELECT distinct untcode FROM table where division='$division'")
or die("Invalid query: " . mysql_query());
echo '<select class="style23" id="unt" name="unt" onchange="sel()">';
echo '<option value="">Select..</option>';
while ($row = mysql_fetch_array($res))
{
$va1 = $row['untcode'];
if(isset($_POST['unt']) )
{
if($va1==$_POST['unt'])
{
echo "<option value='$va1' selected>$va1</option>";
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
echo '</select>';
?>
when user select his unit corresponding value again fetch form mysql and fill to other combobox but onchange() my browers url change http://localhost/MIS/PS/add/add_ps2.php and other combobox value are not fetching form mysql. i make a function sel() <document.form.submit()> onchange combobox item.but problem is not solving
please help me form rohit
i have a login page.
<form name="form" id="form" action="aa.php" method="post">
...
<input name="txtusername" id="txtusername" type="text" width="70px" class="style23"/>
<input name="txtpass" type="password" width="70px" class="style23"/>
...... button here...
</form>
after login i am getting login name of user form URl ->http://localhost/MIS/PS/add/add_ps2.php?name=champawat.in second page i hva three combobox(unit,achivements,crop).the data they containing fetch form mysql on the basis of login name entered. i am fetching unit form mysql below code....
<?php
$d=$_GET['loginname'];
$res = mysql_query("SELECT distinct untcode FROM table where division='$division'")
or die("Invalid query: " . mysql_query());
echo '<select class="style23" id="unt" name="unt" onchange="sel()">';
echo '<option value="">Select..</option>';
while ($row = mysql_fetch_array($res))
{
$va1 = $row['untcode'];
if(isset($_POST['unt']) )
{
if($va1==$_POST['unt'])
{
echo "<option value='$va1' selected>$va1</option>";
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
else
{
echo "<option value='$va1'>$va1</option>";
}
}
echo '</select>';
?>
when user select his unit corresponding value again fetch form mysql and fill to other combobox but onchange() my browers url change http://localhost/MIS/PS/add/add_ps2.php and other combobox value are not fetching form mysql. i make a function sel() <document.form.submit()> onchange combobox item.but problem is not solving
please help me form rohit
•
•
•
•
when user select his unit corresponding value again fetch form mysql and fill to other combobox but onchange() my browers url change http://localhost/MIS/PS/add/add_ps2.php and other combobox value are not fetching form mysql. i make a function sel() <document.form.submit()> onchange combobox item.but problem is not solving
please help me form rohit
php Syntax (Toggle Plain Text)
$res = mysql_query("SELECT distinct untcode FROM table where division='$division'") or die("Invalid query: " . mysql_query());
php Syntax (Toggle Plain Text)
$res = mysql_query("SELECT `distinct untcode` FROM `table` where `division`='".$division."'") or die("Invalid query: " . mysql_error());
php Syntax (Toggle Plain Text)
$res = mysql_query("SELECT `distinct`, `untcode` FROM `table` where `division`='".$division."'") or die("Invalid query: " . mysql_error());
So the above is what I have notices without fully understanding the problem although you did describe what is happening ok.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
![]() |
Similar Threads
- Different problems in my application (C#)
- ComboBox - please help (Visual Basic 4 / 5 / 6)
- TexField change Integer Also Combobox (Java)
- problem in listing directories in list box (Java)
- VB.NET ComboBox & Statusbar HELP! (VB.NET)
- anyone can help me, plzzz??? (VB.NET)
- 100T NIC going only 10T speeds (help!) (Networking Hardware Configuration)
Other Threads in the PHP Forum
- Previous Thread: ttf font uploading problem?
- Next Thread: convert indian rupees to words
| Thread Tools | Search this Thread |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions simple sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube






