|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Working with Radio Button
I have a radio button in a form that passes a "yes" statement to a mysql db. In the output script, I am displaying only the information associated with the "yes" field in that row, but nothing for other rows that do not contain the "yes".
Here is what I am trying to do: <php> $query2 = "SELECT * FROM tablename WHERE person = '".$username."' and popup='yes' "; $result2 = @mysql_query($query2, $connection); if ($result2 = "0") { print "the end";} else { $popup1 = "<a href=\"teacherpage.php\" onClick=\"MM_openBrWindow('newspopup.php?id=$id','News','men ubar=yes,scrollbars=yes,resizable=yes,width=500,he ight=200')\">More News...</a>"; echo "$popup1"; } </php> So I have a page that displays news from a database, and some users may want to input "More News..." so in the user input form for news, they check the radio button for More News... and then a textbox for the "rest of the story" since the news list is very short. the field for the radio button is currently a VARCHAR 50long. I will accept the "yes" okay, but the if statement is funky. I am just looking for rows in the table that contain the usersname since all users save to the same table, and the column popup that contains a yes. It is looped to check all rows, so some news will NOT contain "yes" since they have no More News, so no link will be provided. Please help if possible.
__________________
bow wow! |
|
#2
|
|||
|
|||
|
I got it to work...
![]() |
|
#3
|
||||
|
||||
|
Sweet! Glad to hear that you figured it out... Isn't it a great feeling when you're sitting there pulling your hair out and cant figure something out, when it just suddenly hits you! What did you have to do? Share, if you don't mind
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Working with Radio Button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|