Jump to content

kazil

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Posts posted by kazil

  1. Never did this, but something like this should help:

     

    class BasicController extends Zend_Controller_Action
    {
        public static $variable = '';
    
        public function init()
        {
            self::$variable = 'assign value';
        }
    }
    
    class BioController extends BasicController
    {
        public function indexAction()
        {
            $bioVar = parrent::$variable;
        }
    }
    

     

  2. I'm not sure what's the error about, so let's try a different approach :)

     

    Why don't you use the model for working with the database? That's the point of the MVC.

     

    I'll try to write a basic model for your comments table, based on the info provided. This model should go in: /Library/WebServer/Documents/villa4life/application/models/Comments.php

     

    <?php
    
    class Comments extends Zend_Db_Table
    {
    protected $_name = 'comments'; // The table name
    protected $_primary = 'id_comment'; // The name of the primary column
    protected $_schema = 'database_name'; // Name of the database
    
    public function getAll()
    {
    	$sql = $this->select()->from('comments');	
    	$rowsetComments = $this->fetchAll($sql);
    	return $rowsetComments;
    }
    
    }
    
    ?>
    

     

    Now, the 'id_comment', 'comment', 'author' and the 'date' columns here are fictitious, change them to suit your scenario. To use it in the controller, use it like this:

    // some where in some action function...
    $comments = new Comments();
    $this->view->comment = $comments->getAll();
    

    And that should do it...

  3. while($row = mysql_fetch_array($result1, MYSQL_NUM)) {
       $test_id[$count_col]      = $row[0];
       $temperature[$count_col]   = $row[1];
       $orientation[$count_col]   = $row[2];
       $strength[$count_col]      = $row[3];
       etc...
    }

    Where did you defined $count_col? I see it only after the IF statement. Try adding a $count_col before this WHILE loop

  4. I've got it!  ;D

     

    elseif($jstat == "666") {
    echo "<tr>";
    echo "<td bgcolor=\"" . $colrbg . "\" align=\"center\" valign=\"top\"><font class=\"font_gen\">" . $jtit . "</font></td>";
    echo "<td bgcolor=\"" . $colrbg . "\" align=\"center\" valign=\"top\" width=\"116\"><font class=\"font_gen\">" . $jpost . "</font></td>";
    echo "<td bgcolor=\"" . $colrbg . "\" align=\"center\" valign=\"top\" width=\"66\"><font class=\"font_gen\">" . $jID . "</font></td>";
    echo "<td bgcolor=\"" . $colrbg . "\" align=\"center\" valign=\"top\" width=\"45\"><font class=\"font_gen\"><img src=\"images/icon_inactive.png\" border=\"0\"></font></td>";
    echo "<\tr>";
    

    There, the last line! You see it? It's a <\tr>. Should be a </tr>.

     

    Cheers :)

  5. [quote author=Maq link=topic=112560.msg1008685#msg1008685 date=1223432135]I'm almost in the same boat as you.  Did a web development internship since last semester and still working there.  I don't have 2 exams but 2 classes left till graduation in December.  Good luck to you!
    [/quote]
    Good luck to you, too :)
  6. Not completely a self-taught, had 2-3 classes at college 'bout web development and programming, but that was not enough even to make a basic CRUD web app... By the dictionary, no, I'm not a self-taught... By the amount of knowledge that I gained myself vs. in formal education, then, yeah, I'm a self taught.

    I think that besides formal education you need to put a lot into developing your skills, many hacking till the early morning, so in the end, everybody is more a self-taught then not...

  7. Greetings fellow coders  8)

    I'm Robert, 22 years old, from Serbia. Into PHP for about 2 years now, did some smaller and bigger projects, currently I'm more focusing on finishing the college (only 2 more exams). Did a full time job as PHP programmer for 5 months, that was cool, but freelancing suits me better :)

    A few months ago I fell in love with Zend Framework, using it quite well, but still have to learn a lot about it.

    Besides PHP I was foolin' around with Python, hope I'll get back to it one day.

    In my spare time I write my blog.

    Listening to rock and metal music.

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