PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old June 28th, 2002, 03:38 PM
chinni chinni is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 58 chinni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Option value

Hello, i have an option field which has two values in it.ClassA and ClassB.By default it shows ClassA and when i select ClassB, the value is stored in the db and it is shown after i submit it.
I have set option value=0 for classA and 1 for ClassB.Now, when i select Class B and save it, it still shows ClassA but in the db it shows1.
since in the db, it is stored as 1, i want ClassB to be displayed in my form.How can i fix this one.Hope some body would help me.

Thank you
------------others.ini---------------
<?
if ($frm_save == 1)
{

$sql = "update TBL1 SET ARICLASS = '$ariclass'";
$result = ibase_query($connection, $sql);
}
$db = 'Select ARICLASS from TBL1';
$bsc = ibase_query($connection, $db);
while ($row = ibase_fetch_object($bsc))
?>


<SELECT size=1 name=ariclass>
<OPTION value="0"<?php
if ($row->MOB_ARICLASS==0) {
echo ' selected="selected"';
}?>>ARI CLASSA</OPTION>
<OPTION value="1"<?php
if ($row->MOB_ARICLASS==1) {
echo ' selected="selected"';
}?>>ARI CLASSB</OPTION>
</SELECT>

?>

-------------.php....................

<?php
include "dbconnection.ini";

?>
<form name="frm_main" method="post">
<?php
include "others.oam";

?>

<br></b><input type="submit" name="save_button" value="Save"></br>
<input type="hidden" name="frm_save" value="1">
</form>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Option value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway