Skip to content

Instantly share code, notes, and snippets.

@montes
Last active December 17, 2015 01:49
Show Gist options
  • Select an option

  • Save montes/5531508 to your computer and use it in GitHub Desktop.

Select an option

Save montes/5531508 to your computer and use it in GitHub Desktop.

Revisions

  1. montes renamed this gist Aug 21, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. montes revised this gist May 7, 2013. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -7,18 +7,19 @@
    exit();
    }

    /*
    $sql = "";
    $mysqli->query($sql);
    */

    $sql = "SELECT * FROM users";

    /*
    $result = $mysqli->query("SELECT * FROM users");
    if ($result){
    $result = $mysqli->query($sql);
    if ($result) {
    while ($row = $result->fetch_object()) {
    echo $user->email . '<br>';
    }

    $result->close();
    $mysqli->next_result();
    }
    */
    }
  3. montes revised this gist May 7, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -12,13 +12,13 @@


    /*
    $result = $db->query("SELECT * FROM users");
    $result = $mysqli->query("SELECT * FROM users");
    if ($result){
    while ($row = $result->fetch_object()) {
    echo $user->email . '<br>';
    }
    $result->close();
    $db->next_result();
    $mysqli->next_result();
    }
    */
  4. montes created this gist May 7, 2013.
    24 changes: 24 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <?php

    $mysqli = new mysqli("localhost", "root", "password", "database");

    if ($mysqli->connect_errno) {
    printf("Connect failed: %s\n", $mysqli->connect_error);
    exit();
    }

    $sql = "";
    $mysqli->query($sql);


    /*
    $result = $db->query("SELECT * FROM users");
    if ($result){
    while ($row = $result->fetch_object()) {
    echo $user->email . '<br>';
    }
    $result->close();
    $db->next_result();
    }
    */