IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Zend_Db PHP Discussion :

->find() sur SQL Server


Sujet :

Zend_Db PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Etudiant
    Inscrit en
    Juillet 2008
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Juillet 2008
    Messages : 37
    Par défaut ->find() sur SQL Server
    Bonjour,

    je fais face a un petit probleme :

    quand je fais un var_dump de mon objet apres un ->find($id); je me retourve avec un objet bizarre de l'espace au lieux de m'on occurence.

    une idée?

    merci d'avance.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    $id = $this->_getParam('id');   
     
            $q = new Questions();
            $q->find($id);
            var_dump($q);
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
     
    object(Questions)[51]
      protected '_tableInstance' => null
      protected '_definition' => null
      protected '_definitionConfigName' => null
      protected '_db' => 
        object(Zend_Db_Adapter_Sqlsrv)[8]
          protected '_config' => 
            array
              'dbname' => string '*******' (length=11)
              'username' => string '****' (length=5)
              'password' => string '****' (length=6)
              'adapter' => string 'sqlsrv' (length=6)
              'host' => string '********' (length=19)
              'charset' => null
              'persistent' => boolean false
              'options' => 
                array
                  ...
              'driver_options' => 
                array
                  ...
          protected '_lastInsertId' => null
          protected '_lastInsertSQL' => string 'SELECT SCOPE_IDENTITY() as Current_Identity' (length=43)
          protected '_numericDataTypes' => 
            array
              0 => int 0
              1 => int 1
              2 => int 2
              'INT' => int 0
              'SMALLINT' => int 0
              'TINYINT' => int 0
              'BIGINT' => int 1
              'DECIMAL' => int 2
              'FLOAT' => int 2
              'MONEY' => int 2
              'NUMERIC' => int 2
              'REAL' => int 2
              'SMALLMONEY' => int 2
          protected '_defaultStmtClass' => string 'Zend_Db_Statement_Sqlsrv' (length=24)
          protected '_fetchMode' => int 2
          protected '_profiler' => 
            object(Zend_Db_Profiler)[9]
              protected '_queryProfiles' => 
                array
                  ...
              protected '_enabled' => boolean true
              protected '_filterElapsedSecs' => null
              protected '_filterTypes' => null
          protected '_defaultProfilerClass' => string 'Zend_Db_Profiler' (length=16)
          protected '_connection' => resource(78, SQL Server Connection)
          protected '_caseFolding' => int 0
          protected '_autoQuoteIdentifiers' => boolean true
          protected '_allowSerialization' => boolean true
          protected '_autoReconnectOnUnserialize' => boolean false
      protected '_schema' => null
      protected '_name' => string 'questions' (length=9)
      protected '_cols' => 
        array
          0 => string 'id' (length=2)
          1 => string 'subject' (length=7)
          2 => string 'id_user' (length=7)
          3 => string 'state' (length=5)
      protected '_primary' => 
        array
          1 => string 'id' (length=2)
      protected '_identity' => int 1
      protected '_sequence' => boolean true
      protected '_metadata' => 
        array
          'id' => 
            array
              'SCHEMA_NAME' => null
              'TABLE_NAME' => string 'questions' (length=9)
              'COLUMN_NAME' => string 'id' (length=2)
              'COLUMN_POSITION' => int 1
              'DATA_TYPE' => string 'int' (length=3)
              'DEFAULT' => null
              'NULLABLE' => boolean false
              'LENGTH' => int 4
              'SCALE' => int 0
              'PRECISION' => int 10
              'UNSIGNED' => null
              'PRIMARY' => boolean true
              'PRIMARY_POSITION' => int 1
              'IDENTITY' => boolean true
          'subject' => 
            array
              'SCHEMA_NAME' => null
              'TABLE_NAME' => string 'questions' (length=9)
              'COLUMN_NAME' => string 'subject' (length=7)
              'COLUMN_POSITION' => int 2
              'DATA_TYPE' => string 'text' (length=4)
              'DEFAULT' => null
              'NULLABLE' => boolean false
              'LENGTH' => int 2147483647
              'SCALE' => null
              'PRECISION' => int 2147483647
              'UNSIGNED' => null
              'PRIMARY' => boolean false
              'PRIMARY_POSITION' => null
              'IDENTITY' => boolean false
          'id_user' => 
            array
              'SCHEMA_NAME' => null
              'TABLE_NAME' => string 'questions' (length=9)
              'COLUMN_NAME' => string 'id_user' (length=7)
              'COLUMN_POSITION' => int 3
              'DATA_TYPE' => string 'int' (length=3)
              'DEFAULT' => null
              'NULLABLE' => boolean false
              'LENGTH' => int 4
              'SCALE' => int 0
              'PRECISION' => int 10
              'UNSIGNED' => null
              'PRIMARY' => boolean false
              'PRIMARY_POSITION' => null
              'IDENTITY' => boolean false
          'state' => 
            array
              'SCHEMA_NAME' => null
              'TABLE_NAME' => string 'questions' (length=9)
              'COLUMN_NAME' => string 'state' (length=5)
              'COLUMN_POSITION' => int 4
              'DATA_TYPE' => string 'int' (length=3)
              'DEFAULT' => null
              'NULLABLE' => boolean false
              'LENGTH' => int 4
              'SCALE' => int 0
              'PRECISION' => int 10
              'UNSIGNED' => null
              'PRIMARY' => boolean false
              'PRIMARY_POSITION' => null
              'IDENTITY' => boolean false
      protected '_metadataCache' => null
      protected '_metadataCacheInClass' => boolean true
      protected '_rowClass' => string 'Zend_Db_Table_Row' (length=17)
      protected '_rowsetClass' => string 'Zend_Db_Table_Rowset' (length=20)
      protected '_referenceMap' => 
        array
          empty
      protected '_dependentTables' => 
        array
          empty
      protected '_defaultSource' => string 'defaultNone' (length=11)
      protected '_defaultValues' => 
        array
          empty

  2. #2
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    c'est normale ...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $r = $q->find($id);
    var_dump($r);

  3. #3
    Membre averti
    Homme Profil pro
    Etudiant
    Inscrit en
    Juillet 2008
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Juillet 2008
    Messages : 37
    Par défaut
    euh, j'ai jamais fais comme ca pour loader un objet

    de plus, quand j'affecte le find dans une variable, celle-ci est un boolean ( et egal a false )

    merci d'avance

  4. #4
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    Question et de quelle classe ? Zend_Db_Table ?

    je vois vraiment pas comment tu faisais avant ...

    http://framework.zend.com/manual/fr/....db.table.find

  5. #5
    Membre averti
    Homme Profil pro
    Etudiant
    Inscrit en
    Juillet 2008
    Messages
    37
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Juillet 2008
    Messages : 37
    Par défaut
    Questions extends core_table extends Zend_Db_Table_Abstract

  6. #6
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    Citation Envoyé par madd63 Voir le message
    Questions extends core_table extends Zend_Db_Table_Abstract
    donc c'est bien comme je t'ai monté : cf message plus haut

Discussions similaires

  1. Help!! Probleme avec les dates sur SQL SERVER
    Par Nadaa dans le forum MS SQL Server
    Réponses: 16
    Dernier message: 03/08/2006, 16h55
  2. [debutant]Auto incrementation sur sql-server 2000
    Par syl2095 dans le forum MS SQL Server
    Réponses: 9
    Dernier message: 18/11/2004, 18h00
  3. SqlCommand sur SQL Server 7.0
    Par sangokus dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 08/03/2004, 10h22
  4. Replication d'une base AS/400 sur SQL Server
    Par david_chardonnet dans le forum Autres SGBD
    Réponses: 9
    Dernier message: 21/11/2003, 11h17
  5. problème de float sur SQL server 2000.
    Par fidji dans le forum MS SQL Server
    Réponses: 9
    Dernier message: 24/07/2003, 14h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo