General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 15th, 2003, 04:55 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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!

Reply With Quote
  #2  
Old July 15th, 2003, 05:53 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Wink

I got it to work...

Reply With Quote
  #3  
Old July 16th, 2003, 01:10 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Working with Radio Button


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 1 hosted by Hostway
Stay green...Green IT