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.
Quick mysql+php script
<?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();
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment