Skip to content

Instantly share code, notes, and snippets.

@RusAlex
Created July 30, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RusAlex/bd5665e16190d11cf3b5 to your computer and use it in GitHub Desktop.
Save RusAlex/bd5665e16190d11cf3b5 to your computer and use it in GitHub Desktop.
<?php
$link = mysqli_connect("localhost","","","yiitest") or die("Error " . mysqli_error($link));
$query = "SELECT id,val FROM bit_values" or die("Error in the consult.." . mysqli_error($link));
$result = $link->query($query);
//display information:
while($row = mysqli_fetch_array($result)) {
var_dump($row);
}
/**
array(4) {
[0]=>
string(1) "1"
["id"]=>
string(1) "1"
[1]=>
string(1) "0"
["val"]=>
string(1) "0"
}
array(4) {
[0]=>
string(1) "2"
["id"]=>
string(1) "2"
[1]=>
string(1) "1"
["val"]=>
string(1) "1"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment