Jump to content

Compound Variables


Drainy

Recommended Posts

Hi,

 

I dont know if this exists or is possible.

I have the results of an SQL query saved into $result.

Now the only way I can see to view this is using a while loop with fetch_assoc.

However I want to save the values of each field into their own variables.

Is there an easy way to do that?

 

Failing that I am trying to put two variables together to make one.... eg;

$name$i

I would then incrememnt $i during the loop so each field is saved into its own variable, $name0, $name1, $name 2 etc.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/142184-compound-variables/
Share on other sites

I have a page that will allow a user to change "rates" set in the rates table.

I am trying to get the page to load the current rates into the text boxes as the default value so they know what the previous rates were before editing.

My issue is that I did alot with PHP many years ago but now its like learning it again and im falling down on the basics now.

I have a resource in the form of $result (from the sql query) that I cant do anything with, I need all the data out of it into a usable form.

Link to comment
https://forums.phpfreaks.com/topic/142184-compound-variables/#findComment-744816
Share on other sites

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.