Jump to content

[SOLVED] MySql While Loop


zackcez

Recommended Posts

I'm trying to put this in my loop:

" . $row[$stat] . "

Where stat is this by default:

$stat = Attackxp + Woodcuttingxp + Defencexp + Strengthxp + Hitpointsxp + Rangexp + Prayerxp + Magicxp + Cookingxp + Fletchingxp + Fishingxp + Firemakingxp + Craftingxp + Smithingxp + Miningxp + Herblorexp + Agilityxp + Thievingxp + Slayerxp + Farmingxp + Runecraftingxp;

Each item in $stat is in the mysql database....How could I make this correctly work?

Link to comment
https://forums.phpfreaks.com/topic/113119-solved-mysql-while-loop/
Share on other sites

Oh, do you mean that your query returns all those fields (Attackxp, etc...)? If that is the case, your code would just be:

" . $row['Attackxp'] . "<br>" . $row['Woodcuttingxp'] . "<br>" . $row['Defencexp']; //etc...

 

If that isn't what you mean, you will have to be more specific.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.