国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Heim php教程 PHP源碼 Beispielcode für PHP NotORM (das ORM-Framework von PHP).

Beispielcode für PHP NotORM (das ORM-Framework von PHP).

Nov 08, 2016 pm 02:14 PM

NotORM ist eine PHP-Bibliothek zur Vereinfachung der Interaktion mit Datenbanken. Das hervorstechendste Merkmal ist, dass Tabellenbeziehungen sehr einfach zu handhaben sind. Darüber hinaus ist die Leistung von NotORM sehr hoch und die Einstellungen sind h?her als beim integrierten Treiber.

Mit Datenbank verbinden

include "NotORM.php";
$pdo = new PDO("mysql:dbname=software");
$db = new NotORM($pdo);

Daten lesen

foreach ($db->application() as $application) { // get all applications
    echo "$application[title]\n"; // print application title
}

Bedingte Abfrage

$applications = $db->application()
    ->select("id, title")
    ->where("web LIKE ?", "http://%")
    ->order("title")
    ->limit(10)
;
foreach ($applications as $id => $application) {
    echo "$application[title]\n";
}

Ergebnisse lesen

$application = $db->application[1]; // get by primary key
$application = $db->application("title = ?", "Adminer")->fetch();

Tabellenzuordnung verarbeiten

echo $application->author["name"] . "\n"; // get name of the application author
foreach ($application->application_tag() as $application_tag) { // get all tags of $application
    echo $application_tag->tag["name"] . "\n"; // print the tag name
}

Gemeinsame Abfrage JOIN

// get all applications ordered by author's name
foreach ($db->application()->order("author.name") as $application) {
    echo $application->author["name"] . ": $application[title]\n";
}

Ergebnismengengruppierung

echo $db->application()->max("id"); // get maximum ID
foreach ($db->application() as $application) {
    // get count of each application's tags
    echo $application->application_tag()->count("*") . "\n";
}

Vollst?ndiges Beispiel

<?php
include "NotORM.php";
$connection = new PDO("mysql:dbname=software");
$software = new NotORM($connection);
 
foreach ($software->application()->order("title") as $application) { // get all applications ordered by title
    echo "$application[title]\n"; // print application title
    echo $application->author["name"] . "\n"; // print name of the application author
    foreach ($application->application_tag() as $application_tag) { // get all tags of $application
        echo $application_tag->tag["name"] . "\n"; // print the tag name
    }
}
?>

Erkl?rung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Hei?e KI -Werkzeuge

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Clothoff.io

Clothoff.io

KI-Kleiderentferner

Video Face Swap

Video Face Swap

Tauschen Sie Gesichter in jedem Video mühelos mit unserem v?llig kostenlosen KI-Gesichtstausch-Tool aus!

Hei?e Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)