1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

How to connect this script with database (MySQL)

Discussion in 'Scripting' started by TheUltraBlogger, Sep 13, 2018.

  1. TheUltraBlogger

    TheUltraBlogger Junior Member

    Joined:
    May 8, 2015
    Messages:
    133
    Likes Received:
    109
    Gender:
    Male
  2. Miraz0

    Miraz0 Jr. VIP Jr. VIP

    Joined:
    Sep 28, 2018
    Messages:
    146
    Likes Received:
    22
    Gender:
    Male
    You are missing the SQL file. If you have it, edit the file configClass.php under the folder functions. Put the info in the PDO initiation line.
     
    • Thanks Thanks x 1
  3. Lala57

    Lala57 Newbie

    Joined:
    Dec 26, 2017
    Messages:
    18
    Likes Received:
    1
    Gender:
    Male
    what course are you learning from
     
  4. TheUltraBlogger

    TheUltraBlogger Junior Member

    Joined:
    May 8, 2015
    Messages:
    133
    Likes Received:
    109
    Gender:
    Male
    Not working brother. Still redirecting to http://app.pushbuttontraffic3.com/elite/login.php, while it's actually installed at WAMP.
     
  5. TheUltraBlogger

    TheUltraBlogger Junior Member

    Joined:
    May 8, 2015
    Messages:
    133
    Likes Received:
    109
    Gender:
    Male
    https://mega.nz/fm/tWhASQQa check the functions folder here
     
  6. lordes blandos

    lordes blandos Newbie

    Joined:
    Dec 2, 2016
    Messages:
    13
    Likes Received:
    0
    Any news ? has it worked ? You must edit constants.php for site links
    I need sql files can you upload please.
     
  7. Red Hat Cop

    Red Hat Cop BANNED BANNED

    Joined:
    Oct 30, 2018
    Messages:
    220
    Likes Received:
    41
    Gender:
    Female
    use @ before your connectn and Db select in new wamp extensin despreted
     
  8. Netkas

    Netkas Registered Member

    Joined:
    Sep 16, 2017
    Messages:
    82
    Likes Received:
    22
    Occupation:
    Programmer
    Location:
    Moscow, Russia
    A simple way to to do this is simply using mysqli

    PHP:
    <?PHP
     $mysqli 
    mysqli_connect("example.com""user""password""database");
     
    $res mysqli_query($mysqli"SELECT * FROM `example`");
     
    $row mysqli_fetch_assoc($res);
     echo 
    $row['_msg'];
    More information can be found here: http://php.net/manual/en/mysqli.quickstart.dual-interface.php

    I recommend using MySQL OOP Though.
     
    Last edited: Nov 8, 2018
  9. Bulk-SMS-Sender

    Bulk-SMS-Sender Newbie

    Joined:
    Dec 2, 2018
    Messages:
    21
    Likes Received:
    17
    Gender:
    Male
    I recommend using PDO

    PHP:
    <?php
    try {
        
    $dbh = new PDO('mysql:host=localhost;dbname=test'$user$pass);
        foreach(
    $dbh->query('SELECT * from FOO') as $row) {
            
    print_r($row);
        }
        
    $dbh null;
    } catch (
    PDOException $e) {
        print 
    "Error!: " $e->getMessage() . "<br/>";
        die();
    }
    ?>
     
    • Thanks Thanks x 1