Jump to content

parino_esquilado

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Posts posted by parino_esquilado

  1.  

    <?php
    class a {
    var $things;
    public function __construct($stuff) {
    	$this->things = new b;
    }	
    }
    class b {
    var $morethings;
    $this->morethings = "something";
    }
    
    $c = new a();
    
    echo $c->things->__PARENT__;
    ?>
    

     

    Are a and b related now?

  2. Take the following example:

     

    <?php
    class a {
    var $things;
    public function __construct($stuff) {
    	$this->things = $stuff;
    }	
    }
    class b {
    var $morethings;
    $this->morethings = "something";
    }
    
    $c = new a(new b);
    
    echo $c->things->__PARENT__;
    ?>
    

     

    The line "echo $c->things->__PARENT__;" (as you can probably imagine) does not work. How would I output what the 'b' object is stored in ('a')?

  3. 
    $qInsert = "INSERT INTO `photos` 
    (`photo_name`)
    	VALUES                    
    	('".$photo."')";
    
    

     

    
    $qInsert = "INSERT INTO photos (photo_name) VALUES ('$photo')";
    
    

     

    That probably won't fix it, but the way you wrote it annoyed me lol

  4. @parino_ : you actualy read all that?  I strated to loose focus when the variables were being assigned  :shrug:

     

    ...if only there was something in the forum post BBCode that would make it clearer and easier to read..... ;D

     

    TOTALY agree though - there is no way on this plannet (or any other one that I have visited recently) that you (zanycyborg) could write that code and have never learned how to assign an array, or at the very least be in a possition get what you needed from the php manual.

     

    No lol. :D

  5. The code I posted just replaces these functions

     

    function set_mob_name($mob_name) { 
    $this->mob_name = $mob_name;  
    }
    function get_mob_name() {
    return $this->mob_name;
    }
    function set_attack($attack) {
    $this->attack = $attack;
    }
    function get_attack() {
    return $this->attack;
    }
    function set_mob_hp($mob_hp) {
    $this->mob_hp = $mob_hp;
    }
    function get_mob_hp() {
    return $this->mob_hp;
    }
    function set_mob_level($mob_level) {
    $this->mob_level = $mob_level;
    }
    function get_mob_level() {
    return $this->mob_level;
    }
    
    

     

    So, to echo the mob_level you would call:

     

    
    echo $this->get_stat("mob_level");
    
    

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