www.webdeveloper.com
Results 1 to 3 of 3

Thread: Upgrading to mysqli?

Threaded View

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    Wink Upgrading to mysqli?

    I have my script and i am hoping to update to mysqli because I hear that the onld Mysql_connect functions will not work in the future, i am hoping that aperson can translate this script to Mysqli:
    PHP Code:
    define("DB_USERNAME""*****t");
        
    define("DB_PASSWORD""*****");
        
    define("DB_DATABASE""*****");
        
    define("DB_SERVER""127.0.0.1");

        
    $db_handle mysql_connect(DB_SERVERDB_USERNAMEDB_PASSWORD);

        
    $db_found mysql_select_db(DB_DATABASE$db_handle);

        if (
    $db_found || true) {

        
    $SQL "SELECT * FROM members";
        
    $result mysql_query($SQL) or die(mysql_error());

         while ( 
    $row mysql_fetch_assoc($result) ) {

            
    $id $row['member_id'];
            
    $username $row['username'];
            
    $password $row['password'];
            
    $rank $row['rank'];

            
        }

        
    mysql_close($db_handle);

        } else {
        echo 
    "Database NOT Found " $db_handle;
        }

        
    ?> 
    Help is much appreciated.
    Last edited by NogDog; 08-09-2013 at 12:41 AM. Reason: added [php] tags around code, obfuscated password stuff

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles