fixed indentation and typo

This commit is contained in:
Hadis Kakanejadi Fard 2017-02-22 09:21:44 -08:00 committed by GitHub
parent 73a70da397
commit 40893c0ebf

View file

@ -23,7 +23,6 @@ $conn->exec($sql);
$icon = base64_decode("This is some text to test retrieving from binary type columns"); $icon = base64_decode("This is some text to test retrieving from binary type columns");
// Insert data using bind parameters // Insert data using bind parameters
$sql = "INSERT INTO $tableName($columns[0], $columns[1], $columns[2], $columns[3]) VALUES ( ?, ?, ?, ?)"; $sql = "INSERT INTO $tableName($columns[0], $columns[1], $columns[2], $columns[3]) VALUES ( ?, ?, ?, ?)";
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
@ -48,7 +47,7 @@ print_r("Test finished successfully");
//calls various fetch methods //calls various fetch methods
function test_fetch($conn, $tableName, $columnName, $input){ function test_fetch($conn, $tableName, $columnName, $input){
$len = strlen($input); $len = strlen($input);
$result = ""; $result = "";
$sql = "SELECT $columnName from $tableName"; $sql = "SELECT $columnName from $tableName";
@ -84,12 +83,12 @@ function test_fetch($conn, $tableName, $columnName, $input){
$result = ""; $result = "";
$stmt = $conn->query($sql); $stmt = $conn->query($sql);
$result = $stmt->fetchALL( PDO::FETCH_COLUMN ); $result = $stmt->fetchAll( PDO::FETCH_COLUMN );
if( strncmp($result[0], $input, $len) !== 0){ if( strncmp($result[0], $input, $len) !== 0){
print_r("\nRetrieving using fetchALL failed"); print_r("\nRetrieving using fetchAll failed");
} }
} }
?> ?>
--EXPECT-- --EXPECT--
Test finished successfully Test finished successfully