Location: PHPKode > scripts > SODA > soda/exemples/03_utilisations_recommandees_part2.php
<?php
echo "<p><h1>Exemples d'utilisations Recommandées de la Classe SODA:</h1></p>";
echo "<p><h2><b>Partie 2: Utilisation des fichiers</b></h2></p>";
echo "<p><h2>Exemple 1 :</h2></p>";
/*
  Exemple 1: on importe l'objet 1 on l'utilise et on affiche les données
*/
if (@require_once('./03_objet_exporte_0.php')) {
//on execute la requête select_ten
  $exemples[0]->select_ten->exec();
  var_dump($exemples[0]->select_ten->_data);
}
/*Résultat :

object(Array_Object)[9]
  
    array
      'long_ip' => string '214549523' (length=9)
      'host' => string 'threezprinting.com' (length=18)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '418549946' (length=9)
      'host' => string 'mermony.com' (length=11)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '211550389' (length=9)
      'host' => string 'allianceabroad.net' (length=18)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '417550322' (length=9)
      'host' => string 'nxane.com' (length=9)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '203550569' (length=9)
      'host' => string 'molecular.com' (length=13)
      'type' => string '3' (length=1)
*/
echo "<p><h2>Exemple 2 :</h2></p>";
/*
  Exemple 2: on importe l'objet 2 on définit les variables de la requête select_ten et on l'exécute, puis on affiche les données.
*/
if (@require_once('./03_objet_exporte_1.php')) {
//on définit les variables:
  $type="3";
  $exemples[1]->select_ten[0]='4';
  $exemples[1]->select_ten[1]='6';
//on execute la requête select_ten
  $exemples[1]->select_ten->exec();
  var_dump($exemples[1]->select_ten->_data);
}

/*Résultats:
object(Array_Object)[19]
  
    array
      'long_ip' => string '203550569' (length=9)
      'host' => string 'molecular.com' (length=13)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '212550757' (length=9)
      'host' => string 'telacore.com' (length=12)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '418550458' (length=9)
      'host' => string 'balawfirm.com' (length=13)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '212550766' (length=9)
      'host' => string 'nwcsb.com' (length=9)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '212550777' (length=9)
      'host' => string 'lsplc.com' (length=9)
      'type' => string '3' (length=1)
  
    array
      'long_ip' => string '212550778' (length=9)
      'host' => string 'medicbizservices.com' (length=20)
      'type' => string '3' (length=1)
*/
//on affiche le tableau $exemple
var_dump($exemples);
/*Résultats:
array
  0 => 
    object(driver_mysql)[1]
      protected 'read_only' => 
        object(Array_Object)[2]
          public '_persistant' => string 'X3BlcnNpc3RhbnQ=F9T8nftWluze1rCqTGGlMCEJkZVah7C2gYypt1Vqc6faLyLvZBXSZUE3FUD5soV/P6aLiEXb8EYSgOuU/V5fCq6zu9mxs+i8BCUSFx1IlW4DyM0O4MlkBbY7qFIRnwun7OhuPWTSdS/6CH+ignkOmqHiXuHAvbc9EFYsWc+0Mg4=' (length=188)
          public '_driver' => string 'X2RyaXZlcg==ODal5dBD9FSvJx5xy5tcANmc874m5k+5q1wui7zAgicHmNGKfNwH8TdRtxHSRg3A0Emq4guiP1jgqkPLQPPcEr5v3VEQ4ZOSN9pTTMCd4pEry0k03U8U+WE/Ll0UzEObHCsa7CrTaJndyjTJ6uM7l1aAcM2Ob1Jp/1bayAQ6FN4=' (length=184)
          public '_dbtype' => string 'X2RidHlwZQ==t06WyIyI537mmxMSmCYTrwFjPP9Zzutr7azj32+WHkRMbcPCF4DE+xZ9uUvTv345uR+PEPrzqgLTN0jDqybMhu2owCYdVS9CvFCi29RXGBYZ4Vxq9uW2RBQZTwMHRSJ5gKo6nEq9MkZeasSUrbQ1eXMj6k3XWF0CZF/siAJ0h9A=' (length=184)
          public '_connected' => string 'X2Nvbm5lY3RlZA==PGjYmS/H+cdJab77ObL2stlAeuVvzsiY36YHutnuQeFxMVJ/h6NFYS25DmGCT4lgHCmwZRBxOoayM21i+BFTV6R1Mcp+o3A/XJW7vH+jDqp8IAeI9LJJ4sAWgvHhIX22Z/bltX+rqn+nt4Pg1U2ZlOH7Pt3NzJ304M56f0A9OWQ=' (length=188)
          public '_select_db' => string 'X3NlbGVjdF9kYg==JMtB/3B1BUUzZHOglUrzH88ZBo0TiLgK3Y+LALJr4il7KrRK6Zn2TxUPUrkftLFY7avYFqZXWrgzz3JH3asmoRgw2jxZ3eSsxKbjy/krs4uhRN+/xNryJupC5aY3N5PZ5DCxtx1OxBjWqMzRmDFvb00ndNDWI2TDeg+9aK1W7oU=' (length=188)
          public '_requests' => 
            object(Array_Object)[3]
              ...
          public '_errors' => 
            object(Array_Object)[6]
              ...
      protected 'write_only' => 
        object(Array_Object)[7]
          public '_persistant' => string 'X3BlcnNpc3RhbnQ=F9T8nftWluze1rCqTGGlMCEJkZVah7C2gYypt1Vqc6faLyLvZBXSZUE3FUD5soV/P6aLiEXb8EYSgOuU/V5fCq6zu9mxs+i8BCUSFx1IlW4DyM0O4MlkBbY7qFIRnwun7OhuPWTSdS/6CH+ignkOmqHiXuHAvbc9EFYsWc+0Mg4=' (length=188)
          public '_user' => string 'X3VzZXI=sKoT3frDl2U++S8bQjlWpZ0HHDNrhpqwyTeN6vlk4Z4QR+8L45QxYBTTB9MphCgbDD8X7IwaTef54F6gcvQECxn9+TpOHDshEAgb4HnDUxkpQ7ZARgrX2zo0rTnFkUaPuWE+zjYTDAgDiehdd64v5dRjp/OwAnxJuW0JmCPCprU=' (length=180)
          public '_pwd' => string 'X3B3ZA==Xwa2Es58IgDPUQhTHYgYJ3/vzkPVky6zHETCCNtsfMAii0r8tTrMwJjOKWRqOaG6Dr1OQXwFGBw/WaX0F5oidwXn2FJqSEFSMqEq0DcJ4IZd6smbYWy+fN/DfoH9+7l1akd7I3737KvH4pDB6h5L1lMzOsBJ3DtaRfmcNFTnaDk=' (length=180)
          public '_server' => string 'X3NlcnZlcg==RftZWlrNmWc+m9sWrqnd3D/T9pv4RabYRUEtR93URhwUeovVx8ZokJW0VT7vMExd/yYJepelAz9fa7PJVTHXE6Kiga6F9ppUNLXgBDDtbV+5bV4+yTi0rw4A8qGItsl6nI5KJ3F/95dISnpJDuPRRvfH734gSuPlz1iwq3AW4g0=' (length=184)
          public '_dbname' => string 'X2RibmFtZQ==JiNTW7wE2ED6jGY1HF95Jqea0hi1vmlFFqSbJVxRX7fIWpQiXW/IwfsLVEpZYebQtt7pVOj5UIhCW8nBKPR4aEuGqjKjowaT1k+xVLO/KSg5lrOgugZhdLHsI2JBRDLyOBDB4Dgr6COum01fbKm1dOXn3mdK0I/3Ui8b+7Dv0TY=' (length=184)
          public '_requests' => 
            object(Array_Object)[3]
              ...
      protected 'protected' => 
        object(Array_Object)[8]
          public '_vecteur' => string 'sJEH1dcfdyDFcGRVbdMbYQ==' (length=24)
          public '_certificate' => string 'w2ryne2HIF8qjmdEAgBSZflwLTSwL7BYxRgUnInTSdxOhdYRHQSJLg/6wNaf7vRtxrTsogCASXmvx4v0B1lM/m374w9hazqdh2K7p3vfJAf7qP6qDVEh03iI2CHUEfMuFUp7Oviiw1rqsEch5R4RcVi8OSjnkrl2GAWny0ABo6Rx6vBVfXZ0fV+NZ5i/sICmt0GPx6V7x5HnjY87NmJt3xn0+iqrHNGbgTmfrJokL0h5MQ9yhxtEZ7mFTqXA7NKau3APw+ghLOgjOiLoB5g6qhGGyO5clMdw6zSUfxOU3aW3sylCLOZVW0rDI5CGXQ0GqvnGvYqaOBtQEtwor87QIsIaXhMlGNBNLGphWr0+GF3PibwV8kxZzWAtaSqbXeYCKbhq5byGfJlCrog024kza9kKGO0tbKR1+9ptur2w1K2Addbt1zvlZGSdTVje0hKgqo+WncoFA9gNeTEiLuqbWiqKThGCcDiXrdTSo1RjHmEfCw2wRh0sUsRTzb+jIWsj'... (length=1856)
          public '_private_key' => string 'qCYcalO+KdgjFZ5cmOi1ujdOIFXd6opetQJ4PS1Rtlg6u96oemQV/Y7Q49rB06luJhP/tNYLeAFcXOSeuIQpsUH9GqBy4vGbOsq6fjs2GUKiJIkhQ7nRGSa8AHpKWsRiYZhhtdhZZep0l0E0jbErOwvzkAil9+9fCwssFy028Gugzk6cE1BSOLg6L2XfNOIFFjN1f0cTu/wyCz+YyXiO5UrG6mDIIAkKAUKOgDHahw2FaLRohBwKDUZ0DjHoAw53ndRTzYryTpFUF6AiGksgY13MQR++UtmfJMq4UEng6UUk/hh1c14oQyBvRA/2upurjR2VkkrBbsFGK5Fxu39UYT6RzA3QuWZw+GjZRPOrJB8sTAKqfk7RJ181Hy9qbzpZ2TlKT+/giaMEUoh6TK87x2icma5PiFspYGv9qSCab0Em+SO5uGoJJyBt1S7jUPhV3bEpwLXZtqiTKSSrZW2ua8XvpC6AbR5K7eUXMZcpTbRkIMw7s9dbFdEMiO/rUzLg'... (length=1284)
          public '_basedir' => string '/var/www/framework/SODA' (length=23)
          public '_driver_file' => string '/var/www/framework/SODA/drivers/driver_mysql.php' (length=48)
          public '_connection' => resource(10, mysql link)
  1 => 
    object(driver_mysql)[11]
      protected 'read_only' => 
        object(Array_Object)[12]
          public '_persistant' => string 'X3BlcnNpc3RhbnQ=F9T8nftWluze1rCqTGGlMCEJkZVah7C2gYypt1Vqc6faLyLvZBXSZUE3FUD5soV/P6aLiEXb8EYSgOuU/V5fCq6zu9mxs+i8BCUSFx1IlW4DyM0O4MlkBbY7qFIRnwun7OhuPWTSdS/6CH+ignkOmqHiXuHAvbc9EFYsWc+0Mg4=' (length=188)
          public '_driver' => string 'X2RyaXZlcg==ODal5dBD9FSvJx5xy5tcANmc874m5k+5q1wui7zAgicHmNGKfNwH8TdRtxHSRg3A0Emq4guiP1jgqkPLQPPcEr5v3VEQ4ZOSN9pTTMCd4pEry0k03U8U+WE/Ll0UzEObHCsa7CrTaJndyjTJ6uM7l1aAcM2Ob1Jp/1bayAQ6FN4=' (length=184)
          public '_dbtype' => string 'X2RidHlwZQ==t06WyIyI537mmxMSmCYTrwFjPP9Zzutr7azj32+WHkRMbcPCF4DE+xZ9uUvTv345uR+PEPrzqgLTN0jDqybMhu2owCYdVS9CvFCi29RXGBYZ4Vxq9uW2RBQZTwMHRSJ5gKo6nEq9MkZeasSUrbQ1eXMj6k3XWF0CZF/siAJ0h9A=' (length=184)
          public '_connected' => string 'X2Nvbm5lY3RlZA==Sglc/MjS1SthSogcEHXWoZVEV7S5R6NI5X9YlGwhW8ONhetALDk6SnhKxH9nGOQBf6sSB/378EDk70WTR5tS/JQEUCKWU+GdCKN/jYSFhDF4XKx0E0oPuPrzSwmct3vvcfN5MV/sk+BraQgMQ3BLw3vrVA0w9DZv2jVddr6ERHs=' (length=188)
          public '_select_db' => string 'X3NlbGVjdF9kYg==OWn3x5QFg3azLjeiBLLu3RsAF1XF9En0nydgX89qpGj07Uxr02iZWV/I8I6+pim/qmwC2B2sjm4ueJu0KAgxRVXquLLJPbBOGWHykG6JJBLNVOPz+qfa+/Pp//qxaNB2+27uhytqwOatlRJ8qOXkArttQ2eT2CA1cRynVgrjvzw=' (length=188)
          public '_requests' => 
            object(Array_Object)[13]
              ...
          public '_errors' => 
            object(Array_Object)[16]
              ...
      protected 'write_only' => 
        object(Array_Object)[17]
          public '_persistant' => string 'X3BlcnNpc3RhbnQ=F9T8nftWluze1rCqTGGlMCEJkZVah7C2gYypt1Vqc6faLyLvZBXSZUE3FUD5soV/P6aLiEXb8EYSgOuU/V5fCq6zu9mxs+i8BCUSFx1IlW4DyM0O4MlkBbY7qFIRnwun7OhuPWTSdS/6CH+ignkOmqHiXuHAvbc9EFYsWc+0Mg4=' (length=188)
          public '_user' => string 'X3VzZXI=sKoT3frDl2U++S8bQjlWpZ0HHDNrhpqwyTeN6vlk4Z4QR+8L45QxYBTTB9MphCgbDD8X7IwaTef54F6gcvQECxn9+TpOHDshEAgb4HnDUxkpQ7ZARgrX2zo0rTnFkUaPuWE+zjYTDAgDiehdd64v5dRjp/OwAnxJuW0JmCPCprU=' (length=180)
          public '_pwd' => string 'X3B3ZA==Xwa2Es58IgDPUQhTHYgYJ3/vzkPVky6zHETCCNtsfMAii0r8tTrMwJjOKWRqOaG6Dr1OQXwFGBw/WaX0F5oidwXn2FJqSEFSMqEq0DcJ4IZd6smbYWy+fN/DfoH9+7l1akd7I3737KvH4pDB6h5L1lMzOsBJ3DtaRfmcNFTnaDk=' (length=180)
          public '_server' => string 'X3NlcnZlcg==RftZWlrNmWc+m9sWrqnd3D/T9pv4RabYRUEtR93URhwUeovVx8ZokJW0VT7vMExd/yYJepelAz9fa7PJVTHXE6Kiga6F9ppUNLXgBDDtbV+5bV4+yTi0rw4A8qGItsl6nI5KJ3F/95dISnpJDuPRRvfH734gSuPlz1iwq3AW4g0=' (length=184)
          public '_dbname' => string 'X2RibmFtZQ==JiNTW7wE2ED6jGY1HF95Jqea0hi1vmlFFqSbJVxRX7fIWpQiXW/IwfsLVEpZYebQtt7pVOj5UIhCW8nBKPR4aEuGqjKjowaT1k+xVLO/KSg5lrOgugZhdLHsI2JBRDLyOBDB4Dgr6COum01fbKm1dOXn3mdK0I/3Ui8b+7Dv0TY=' (length=184)
          public '_requests' => 
            object(Array_Object)[13]
              ...
      protected 'protected' => 
        object(Array_Object)[18]
          public '_vecteur' => string 'sJEH1dcfdyDFcGRVbdMbYQ==' (length=24)
          public '_certificate' => string 'w2ryne2HIF8qjmdEAgBSZflwLTSwL7BYxRgUnInTSdxOhdYRHQSJLg/6wNaf7vRtxrTsogCASXmvx4v0B1lM/m374w9hazqdh2K7p3vfJAf7qP6qDVEh03iI2CHUEfMuFUp7Oviiw1rqsEch5R4RcVi8OSjnkrl2GAWny0ABo6Rx6vBVfXZ0fV+NZ5i/sICmt0GPx6V7x5HnjY87NmJt3xn0+iqrHNGbgTmfrJokL0h5MQ9yhxtEZ7mFTqXA7NKau3APw+ghLOgjOiLoB5g6qhGGyO5clMdw6zSUfxOU3aW3sylCLOZVW0rDI5CGXQ0GqvnGvYqaOBtQEtwor87QIsIaXhMlGNBNLGphWr0+GF3PibwV8kxZzWAtaSqbXeYCKbhq5byGfJlCrog024kza9kKGO0tbKR1+9ptur2w1K2Addbt1zvlZGSdTVje0hKgqo+WncoFA9gNeTEiLuqbWiqKThGCcDiXrdTSo1RjHmEfCw2wRh0sUsRTzb+jIWsj'... (length=1856)
          public '_private_key' => string 'qCYcalO+KdgjFZ5cmOi1ujdOIFXd6opetQJ4PS1Rtlg6u96oemQV/Y7Q49rB06luJhP/tNYLeAFcXOSeuIQpsUH9GqBy4vGbOsq6fjs2GUKiJIkhQ7nRGSa8AHpKWsRiYZhhtdhZZep0l0E0jbErOwvzkAil9+9fCwssFy028Gugzk6cE1BSOLg6L2XfNOIFFjN1f0cTu/wyCz+YyXiO5UrG6mDIIAkKAUKOgDHahw2FaLRohBwKDUZ0DjHoAw53ndRTzYryTpFUF6AiGksgY13MQR++UtmfJMq4UEng6UUk/hh1c14oQyBvRA/2upurjR2VkkrBbsFGK5Fxu39UYT6RzA3QuWZw+GjZRPOrJB8sTAKqfk7RJ181Hy9qbzpZ2TlKT+/giaMEUoh6TK87x2icma5PiFspYGv9qSCab0Em+SO5uGoJJyBt1S7jUPhV3bEpwLXZtqiTKSSrZW2ua8XvpC6AbR5K7eUXMZcpTbRkIMw7s9dbFdEMiO/rUzLg'... (length=1284)
          public '_basedir' => string '/var/www/framework/SODA' (length=23)
          public '_driver_file' => string '/var/www/framework/SODA/drivers/driver_mysql.php' (length=48)
          public '_connection' => resource(10, mysql link)

*/

?>
Return current item: SODA