View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Update page and select options

Thread began 5/18/2009 10:05 am by phil.evans372967 | Last modified 5/18/2009 1:33 pm by phil.evans372967 | 966 views | 2 replies

phil.evans372967

Update page and select options

Hi all

I'm using a datassist update page to edit records in my database table.

I have a boolean field "contract_signed" which I want to be able to edit using a select drop down and options.

I have figured out how to dispay "yes" and "no" in the options based on the boolean field, and can set the second option (i.e. if field in database is set to 1/yes, that option is selected and the second option is set to 0/no and vice versa) and can change a yes to a no, but can't figure out what I'm doing wrong in the php to be able to change no to yes. Can anyone shed any light for me? My current code is

<select name="contract_signed" id="contract_signed">
<?php
do {
?>
<option value="<?php echo $row_WADAprop_address['contract_signed']?>">
<?php

if ($row_WADAprop_address['contract_signed']==1)
echo "Yes";
else echo "No";

?>
</option>
<?php
} while ($row_WADAprop_address = mysql_fetch_assoc($WADAprop_address));
$rows = mysql_num_rows($WADAprop_address);
if($rows > 0) {
mysql_data_seek($WADAprop_address, 0);
$row_WADAprop_address = mysql_fetch_assoc($WADAprop_address);
}
?>
<option value="<?php if($row_WADAprop_address['contract_signed']==1)
echo "No";
else echo "Yes";
?>">
<?php if($row_WADAprop_address['contract_signed']==1) echo "No"; else echo "Yes";?>
</option>
</select>

Thanks

Phil

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...