Jump to content

Making a variable name with partial use of another variable


Phaelon

Recommended Posts

Does anyone know how I can make a variable name with partial use of another variable?

while ($row = mysql_fetch_assoc($result)) {
    $option'.$row['number'].' = 1;
}



So, I would get:

$option1 = 1
$option2 = 1
$option3 = 1

I tried '$option'.$row['number'].'' = 1;, but it didn't work.

Link to comment
Share on other sites

No, I want to do it my way because there is a bigger picture to what I am doing which I haven't explained as it is irrelevant and I want to keep my thread simple.

 

... So do you know if what I want to do can be done, or are you just lecture me on what you thinks best without providing any assistance what so ever? :)

Edited by Phaelon
Link to comment
Share on other sites

Sure they don't.

 

The code you suggested isn't compatible with what I needed to do. I already told you this.

You need to stop assuming you know other people are trying to do.. and if speeds anything to go by, I'd still be stuck if it wasn't for the other help site.

 

You need to stop over analysing in life. I use to have this problem.

 

 

Cheers.

Edited by Phaelon
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.