public function testEmpty() { isEmpty(0); isEmpty(''); isEmpty(null); isEmpty('0'); isEmpty(0.0); isEmpty(array()); isNotEmpty(array(0)); isNotEmpty(true); isNotEmpty('1'); isNotEmpty(1); }
$stmt->bindParam(":json_info", $info); } $ok = $stmt->execute(); } else { // implicit bind (by array order and no datatype parsing) $ok = $stmt->execute(array_merge($sqls, array($info))); } if (!$ok) { print "\n ---- ERROR (at line-{$n} with error info) ----\n"; print_r($lin0); print_r($stmt->errorInfo()); die("\n"); } else { $n2++; } } elseif ($nsql > 0 && count($sql_fields) && isNotEmpty($lin)) { $lin_check = fields_to_parts(array_slice($lin, 0, $nsql)); if ($sql_fields != $lin_check) { var_dump($lin_check); var_dump($sql_fields); die("\n --- ERROR: CSV header-basic not matches SQL/datapackage field names ---\n"); } } } print " {$n} lines scanned, {$n2} used."; unset($ds[$pack['path']]); } } // if $pack $sampath = "data/samples"; if (isset($ds[$sampath])) {
/** * @test * @since 6.2.0 */ public function nonEmptyLinesOfReturnsNonEmptyLinesOnly() { assert(nonEmptyLinesOf($this->file->url()), isNotEmpty()->and(each(equals('foo')))); }
<?php session_start(); require_once "funksionet.php"; $connection = krijo_lidhje(); if (!isset($_POST['text_koment'])) { echo "kot"; } if (isNotEmpty($_POST['text_koment'])) { $data = date("Y-m-d H:i:s"); $query = "INSERT INTO koment (id_foto, id_user, koment_date_time, koment)\n\t\t\t \tVALUES (" . (int) $_GET['foto'] . ", " . $_SESSION['id'] . ", '" . $data . "', '" . $_POST['text_koment'] . "');"; $result = mysqli_query($connection, $query); } header("location:komento.php?foto=" . $_GET['foto']);
} ?> <!DOCTYPE html> <html> <head> <title>Wink - Error</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Photo Gallery"> <meta name="keywords" content="PHP, Photography"> <meta name="author" content="Fenimore"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- jQuery library --> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <!-- Latest compiled JavaScript --> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> </head> <body> <a href="../auth/admin.php">Return to Admin</a> <?php if (isNotEmpty($error)) { echo '<br>ERRROR:' . $error; } echo '<br>Directory:' . $dirname; echo '<br>Path:' . $path; ?> </body> </html>