close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Checkbox group insert and update values in one field

Thread began 8/10/2010 12:49 am by Roland Rogers | Last modified 8/20/2010 10:17 am by Roland Rogers | 4544 views | 19 replies

johnb

Okay so I have spent the last couple hours trying to get this right on the update page so it will show the correct checkboxes as checked but I can tell I am messing something up with the syntax. It appears to be trying to execute correctly by echoing checked=checked after the checkboxes (outside of the input type string). I am thinking I need to get the second echoed line to be inside the input type string? I just don't know the proper way to structure the syntax here since I am such a noob. (cant wait till I can stop referring to myself that way)


Here is the code:

php:
<?php require_once("Connection.php");
$sql "SELECT * FROM agents"
$pResult=mysql_query($sql) or die(mysql_error()); 
if(
mysql_num_rows($pResult) == 0

 print 
"There are No Records";     

else 

while(
$tmp mysql_fetch_assoc($pResult)) 

 echo 
"<input type=\"checkbox\" name=\"agent_id[]\" value=\"".$tmp["ID"]."\" />"
        echo((
in_array("".$tmp["ID"].""explode(", "$row_WADAtest_table['agent_id'])))?"checked=checked":""); echo $tmp['name'];
        echo 
"<br />"


?>



I am sorry to be asking for so much guidance but would like you to know I really appreciate it and I want to learn this stuff so I AM paying attention.

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...