pdoTest.php 931 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require_once(__DIR__.'/../../3rd_party/php/propel/runtime/lib/Propel.php');
  3. // Initialize Propel with the runtime configuration
  4. //Example how to use PDO:
  5. //Propel::init(__DIR__."/../propel-db/build/conf/airtime-conf.php");
  6. //Add the generated 'classes' directory to the include path
  7. set_include_path(__DIR__."/../propel-db/build/classes" . PATH_SEPARATOR . get_include_path());
  8. $con = Propel::getConnection("campcaster");
  9. $sql = "SELECT COUNT(*) FROM cc_schedule WHERE (starts >= '2010-01-01 00:00:00.000') "
  10. ." AND (ends <= (TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456'))";
  11. $rows1 = $con->query($sql);
  12. var_dump($rows1->fetchAll());
  13. $sql2 = "SELECT COUNT(*) FROM cc_playlistcontents";
  14. $rows2 = $con->query($sql2);
  15. var_dump($rows2->fetchAll());
  16. $sql3 = "SELECT TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456'";
  17. $result3 = $con->query($sql3);
  18. var_dump($result3->fetchAll());