IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42834


Ignore:
Timestamp:
May 9, 2025, 9:11:12 AM (12 months ago)
Author:
eugene
Message:

add example to use PDO database access methods

Location:
trunk/ippMonitor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor

  • trunk/ippMonitor/INSTALL

    r42794 r42834  
    3939# $CZARPLOTDIR and $METRICSPLOTDIR will be generated as links in the same folder as ippMonitor 
    4040# the structure of the names for these two directories are defined in Makefile.in a
     41
    4142# pltdir is for ippMetrics and czartool_plots hyperlinked from /export/ipp113.0/ipp/ in /var/www/localhost/htdocs/ippMonitor
    4243# pltdir in ipp117 is /var/www/localhost/htdocs/ippMonitor
    4344# ippMetrics -> /export/ipp113.0/ipp/ippMetrics/
    4445# czartool_plots -> /export/ipp113.0/ipp/czartool_plots/
    45 psconfigure --htdocs /var/www/localhost/htdocs --wwwbin /var/www/localhost/wwwbin --pltdir /var/www/localhost/htdocs/ippMonitor --site ~/ippconfig/ippmonitor.config
     46# --usePDO selects a modern PHP/mysql interface
     47psconfigure --htdocs /var/www/localhost/htdocs --wwwbin /var/www/localhost/wwwbin --pltdir /var/www/localhost/htdocs/ippMonitor --site ~/ippconfig/ippmonitor.config --usePDO
     48
     49# note that modern php requires the use of PDO, the older MDB2 and DB mysql interfaces have been deprecated
    4650
    4751## NOTES:
  • trunk/ippMonitor/Makefile.in

    r42791 r42834  
    6969$(DESTWWW)/ipp.czartool.dat \
    7070$(DESTWWW)/czartool_labels.php \
    71 $(DESTWWW)/czartool_labels_old.php \
    7271$(DESTWWW)/czartool_getplot.php \
    7372$(DESTWWW)/czartool_exposures.php \
  • trunk/ippMonitor/raw/ipp.php

    r42794 r42834  
    100100  // define the DSN strings. NOTE: PDO uses a different format from DB or MDB2
    101101  if ($database == $CZARDBNAME) {
    102     $dsn_pdo = "mysql:host=$DBHOST;dbname=$database";
     102    $dsn_pdo = "mysql:host=$CZARDBHOST;dbname=$database"; // note this is case sensitive
    103103    $dsn = "mysql://$DBUSER:$DBPASS@$CZARDBHOST/$database";
    104104    $dsnerr = "mysql://$DBUSER:XXX@$CZARDBHOST/$database"; // only used to report the error
    105105  } else {
    106     $dsn_pdo = "mysql:host=$CZARDBHOST;dbname=$database"; // note this is case sensitive
     106    $dsn_pdo = "mysql:host=$DBHOST;dbname=$database";
    107107    $dsn = "mysql://$DBUSER:$DBPASS@$DBHOST/$database";
    108108    $dsnerr = "mysql://$DBUSER:XXX@$DBHOST/$database"; // only used to report the error
Note: See TracChangeset for help on using the changeset viewer.