Jump to content

create $ vith other variables


chriscloyd

Recommended Posts

say you have already set one variable like so

 

$teamname = $teams['teamname'];

 

then can you do this

 

$team + $teamname = 1;

 

?????

That doesn't really make sense but for example you could do

 

$something = 1;

$something2 = $something + $somethingelse;

Link to comment
Share on other sites

no this is what im doing

 

<?php
mysql_connect("localhost","*****",'*****');
mysql_select_db("*****");
$get_teams = mysql_query("SELECT * FROM teams WHERE game = 'cs16' AND division = 'a'") or die(mysql_error());
$teamname = array();
$teamcount = 1;
while ($teams = mysql_fetch_array($get_teams)) {
$teamname[] = $teams['teamname'];
}
foreach ($teamname as $data) {
    $t = $data
    //can i do this somehow
    //like mane a new variable where the teamname from $t is added into the variable
    $t_n_$t = $teamcount;
    $teamcount++;
}
?>

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.