Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Plugin per FF per debug

    Ciao a tutti, mi era capitato di vedere all'opera un tool per FF che consentiva di eseguire un debug tramite breakpoint di codice .... che produceva qualche cosa del tipo:



    Zend_Db_Statement_Exception Object
    (
    [_previous:Zend_Exceptionrivate] =>
    [messagerotected] => SQLSTATE[HY000]: General error: 1364 Field 'datafineerogazione' doesn't have a default value


    [string:Exceptionrivate] =>
    [coderotected] => 0
    [filerotected] => E:\web\library\Zend\Db\Statement\Pdo.php
    [linerotected] => 234


    [trace:Exceptionrivate] => Array
    (
    [0] => Array
    (
    [file] => E:\web\library\Zend\Db\Statement.php


    [line] => 300
    [function] => _execute
    [class] => Zend_Db_Statement_Pdo
    [type] => ->


    [args] => Array
    (
    [0] => Array
    (
    [0] => 13



    Sapete dirmi dove posso trovare questo tool e come funziona esattamente?

    Grazie
    Iceberg

  2. #2
    Utente di HTML.it
    Registrato dal
    Jul 2010
    Messaggi
    65
    Forse stai parlando di firebug

    http://getfirebug.com/

  3. #3
    Confermo...
    Non l'ho mai usato in questo modo, ma dovrebbe essere questo se si tratta di un'estensione di FF

    http://getfirebug.com/errors

  4. #4
    Grazie a tutti per l'aiuto!!
    Iceberg

  5. #5
    Ho provato il programma ma non capisco come fare a recupeare il valore di una variabile.

    Utilizzando zend mi capita di avere delle action nelle quali non posso fare echo valore_var; die; .... ad esempio nel caso in cui credo una stringa json.

    nell'esempio che posto ora, non riesco a visualizzare il valore dell'sql facendo l'echo (non visualzza nessun valore a video), come posso tramite un sistemat di debug tipo quello suggerito

    Codice PHP:
     if ($this->getRequest()->isPost())
            {
                
    $data $this->getRequest()->getPost();

                
    $page $data['page'];
                
    $rp $data['rp'];
                
    $sortname $data['sortname'];
                
    $sortorder $data['sortorder'];

                ...

                
    $sort " ORDER BY $sortname $sortorder ";

                if (!
    $page$page 1;
                if (!
    $rp$rp 10;

                
    $start = (($page-1) * $rp);
                
    $limit "LIMIT $start$rp";

                
    //get query condition if there is set on
                
    $query $data['query'];
                
    $qtype $data['qtype'];
    ......

                
    //get main adapter config
                
    $configuration = new Zend_Config_Ini(APPLICATION_PATH '/configs/application.ini','production');

                
    $dbAdapter Zend_Db::factory($configuration->resources->db->adapter,
                                              
    $configuration->resources->db->params->toArray());
                
                
    //echo $where;exit;

                //Conteggio records utenti col filtro impostato
                
    $stmt $dbAdapter->query('SELECT COUNT(*) As count FROM users'$where);
                
    $countusers $stmt->fetch();
                
    $total $countusers['count'];

                
    //Query finale con where, sort e order
                
    $sql "SELECT * FROM users INNER JOIN state ON state.stateId= users.stateId
                                            INNER JOIN city ON city.cityId= users.cityId
                                            INNER JOIN town ON town.townId= users.townId
                                            
    $where $sort $limit";
                                            
                
    //echo $sql;exit;

                
    $stmt $dbAdapter->query($sql);
                
    $users $stmt->fetchAll();

                
    $json "";
                
    $json .= "{\n";
                
    $json .= "page: $page,\n";
                
    $json .= "total: $total,\n";
                
    $json .= "rows: [";
                
    $rc false;

                foreach (
    $users as $user)
                {

                    if (
    $rc$json .= ",";
                    
    $json .= "\n{";
                    
    $json .= "id:'".$user['userId']."',";
                    
    $json .= "cell:['".addslashes($user['userId'])."'";

                    
    $json .= ",'".$user['regDate']."']";
                    
    $json .= "}";
                    
    $rc true;
                }

                
    $json .= "]\n";
                
    $json .= "}";
                echo 
    $json;
                exit;

            } 
    Iceberg

  6. #6
    Please help me!!!!
    Iceberg

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.