Archived Boards and Threads... > Parham's PHP Tutorials

PHP Lesson 05 - arrays

<< < (4/5) > >>

dracomiconia:
I'll answer myself:


--- Code: ---
//Mysql query... Charging array:


$candidato [] = array(
'datos' => array(
'id_luchador' => $row["ID_REG"],
'fama' => round($row["fama"]/1000,0)+$key+1,
'pais' => $row["pais_escuela"]
),
);


// End of mysql... echo:

echo "La escuela ".$candidato[0]['datos']['id_luchador']." tiene ".$candidato[0]['datos']['fama']." y es del pais ".$candidato[0]['datos']['pais'];


//Gives:

La escuela 1 tiene 4 y es del pais Carsa


--- End code ---

[MiNX]Tek:
Okay... I understood the first post. Kinda knew what you were talking about (never contemplated what an "array" was) but... what would we (forum people) use arrays for?

[Unknown]:
If you've looked at a template in SMF, everything - and I do mean everything - is stored with arrays.  That's how SMF communicates with the theme.

-[Unknown]

Joey Smithâ„¢:

--- Quote from: [Unknown] on September 11, 2004, 06:57:37 PM ---If you've looked at a template in SMF, everything - and I do mean everything - is stored with arrays.  That's how SMF communicates with the theme.

-[Unknown]

--- End quote ---
Oh, how well I am learning this..... Makes my head hurt lmao..

GreenX:
I have the following array setup:


--- Code: ---$fielddef =
  array(
array(
      'caption' =>      "Character Name",
      'name' =>         "charname",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),

--- End code ---

then in another section under it

--- Code: ---      $msgOptions = array(
        'id' =>  0 ,
        'subject' => '[NEW] Application from ' . $fielddef["charname"],
        'body' => $postbody ,
        'icon' => 'xx',
        'smileys_enabled' => true,
        'attachments' =>  array(),
      );

--- End code ---

Basically its to create the subject of a post but using $fielddef["charname"] OR $fielddef['charname'] doesn't reference that field I want, its just blank.

How do I reference that array for that data of charname?

Thanks!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version