![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Registered User
Join Date: Dec 2001
Posts: 529
|
php/mysql question
I know this is not a fucking builder board or anything but most people are using php/mysql, so here is my question:
how do I simplify this piece of code, hence than one day there could be up to 100 buttons. while ($row = mysql_fetch_array($result)) { $button1 = $row['button1']; $button2 = $row['button2']; $button3 = $row['button3']; $button4 = $row['button4']; $button5 = $row['button5']; $button6 = $row['button6']; $button7 = $row['button7']; $button8 = $row['button8']; $button9 = $row['button9']; $button10 = $row['button10']; $button11 = $row['button11']; $button12 = $row['button12']; $button13 = $row['button13']; $button14 = $row['button14']; } Thank yOU>Q><W |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Join Date: Dec 2001
Posts: 529
|
anyone ? please? I'll love you long time!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Join Date: Dec 2001
Posts: 529
|
im not quite getting that... hmm.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
It will extract the array you have to $button1, $button2.....
while ($row = mysql_fetch_array($result)) { extract($row); // After this line you can use // $button1, $button2, ...... } Take a look at the manual page for it, and play around with it. |
![]() |
![]() ![]() ![]() ![]() ![]() |