Changeset 35 for trunk/update_notice.php


Ignore:
Timestamp:
Apr 8, 2018, 4:41:57 PM (6 years ago)
Author:
gegorbet
Message:

mods mostly for use of mysqli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/update_notice.php

    r34 r35  
    9292//   "none" - present in both and messages identical (no DB update).
    9393
    94 $noteLink = mysql_connect( $dbhost, $dbuser, $dbpassw );
     94$noteLink = mysqli_connect( $dbhost, $dbuser, $dbpassw, $notice_db );
    9595
    96 if ( ! mysql_select_db( $notice_db, $noteLink ) )
     96if ( ! $noteLink )
    9797{
    98    echo "Could not select DB $notice_db - " . mysql_error() . "\n";
     98   echo "Could not connect to DB $notice_db - " . mysqli_error($noteLink) . "\n";
    9999   exit();
    100100}
     
    102102$query = "SELECT id, type, revision, message FROM notice";
    103103
    104 $result = mysql_query( $query, $noteLink )
    105    or die( "Query failed : $query<br />" . mysql_error() );
     104$result = mysqli_query( $noteLink, $query )
     105   or die( "Query failed : $query<br />" . mysqli_error($noteLink) );
    106106
    107107echo "=====START of DB QUERY LOOP===== \n";
    108 $num_rows = mysql_num_rows( $result );
     108$num_rows = mysqli_num_rows( $result );
    109109
    110110echo "   numrows = $num_rows \n";
    111 while ( list( $id, $type, $rev, $msg ) = mysql_fetch_array( $result ) )
     111while ( list( $id, $type, $rev, $msg ) = mysqli_fetch_array( $result ) )
    112112{
    113113   $key    = $type . $rev;
     
    180180   echo "      query: [ $query ]  \n";
    181181
    182    $result = mysql_query( $query, $noteLink )
    183       or die( "Query failed : $query<br />" . mysql_error() );
     182   $result = mysqli_query( $noteLink, $query )
     183      or die( "Query failed : $query<br />" . mysqli_error($noteLink) );
    184184
    185185}
Note: See TracChangeset for help on using the changeset viewer.