source.by

MySQL UPDATE - Daten aktualisieren - MySQL Tutorial - PHP & MySQL lernen

Source 2020: https://www.php-einfach.de/mysql-tutorial/daten-aktualisieren/ | 2020-02-07
Mit dem Befehl UPDATE lassen sich in MySQL Daten einer Tabelle aktualisieren.

        <!DOCTYPE html>
<html lang="de-DE">
<head>
<title>MySQL UPDATE - Daten aktualisieren - MySQL Tutorial - PHP & MySQL lernen</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Mit dem Befehl UPDATE lassen sich in MySQL Daten einer Tabelle aktualisieren." />
<meta name="date" content="2020-02-10">
<meta name="DC.date" scheme="W3CDTF" content="2020-02-10">
<meta property="article:published_time" content="2015-07-22T14:29:21+02:00" />
<meta property="article:modified_time" content="2020-02-10T10:07:06+01:00" />
<meta property="og:updated_time" content="2020-02-10T10:07:06+01:00" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.2, user-scalable=yes" />
<!--[if IE 8]>
    <script src="https://www.php-einfach.de/wp-content/themes/custom/scripts/html5.js" type="text/javascript"></script>
    <script src="https://www.php-einfach.de/wp-content/themes/custom/scripts/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<link rel='dns-prefetch' href='//s.w.org' />
<link rel="alternate" type="application/rss+xml" title="PHP lernen » Feed" href="https://www.php-einfach.de/feed/" />
<link rel="alternate" type="application/rss+xml" title="PHP lernen » Kommentar-Feed" href="https://www.php-einfach.de/comments/feed/" />
<link rel='stylesheet' id='crayon-css' href='https://www.php-einfach.de/wp-content/plugins/phpeinfach-syntax-highlighter/css/min/crayon.min.css?ver=1.0.0' type='text/css' media='all' />
<link rel='stylesheet' id='crayon-theme-nils-css' href='https://www.php-einfach.de/wp-content/uploads/phpeinfach-syntax-highlighter/themes/nils/nils.css?ver=1.0.0' type='text/css' media='all' />
<link rel='stylesheet' id='crayon-font-consolas-css' href='https://www.php-einfach.de/wp-content/plugins/phpeinfach-syntax-highlighter/fonts/consolas.css?ver=1.0.0' type='text/css' media='all' />
<link rel='stylesheet' id='wp-block-library-css' href='https://www.php-einfach.de/wp-includes/css/dist/block-library/style.min.css?ver=5.3.2' type='text/css' media='all' />
<link rel='stylesheet' id='cookielawinfo-style-css' href='https://www.php-einfach.de/wp-content/plugins/cookie-law-info/css/cli-style.css?ver=1.5.9' type='text/css' media='all' />
<link rel='stylesheet' id='toc-screen-css' href='https://www.php-einfach.de/wp-content/plugins/table-of-contents-plus/screen.min.css?ver=1509' type='text/css' media='all' />
<link rel='stylesheet' id='bootstrap3.min-css' href='https://www.php-einfach.de/wp-content/themes/custom/css/bootstrap3.min.css?ver=5.3.2' type='text/css' media='all' />
<link rel='stylesheet' id='font-awesome.min-css' href='https://www.php-einfach.de/wp-content/themes/custom/css/font-awesome.min.css?ver=5.3.2' type='text/css' media='all' />
<link rel='stylesheet' id='newsletter-css' href='https://www.php-einfach.de/wp-content/plugins/newsletter/style.css?ver=5.7.4' type='text/css' media='all' />
<script type='text/javascript' src='https://www.php-einfach.de/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var Cli_Data = {"nn_cookie_ids":null};
/* ]]> */
</script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-content/plugins/cookie-law-info/js/cookielawinfo.js?ver=1.5.9'></script>
<link rel='https://api.w.org/' href='https://www.php-einfach.de/wp-json/' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.php-einfach.de/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.php-einfach.de/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 5.3.2" />
<link rel="canonical" href="https://www.php-einfach.de/mysql-tutorial/daten-aktualisieren/" />
<link rel='shortlink' href='https://www.php-einfach.de/?p=341' />
<link rel="alternate" type="application/json+oembed" href="https://www.php-einfach.de/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.php-einfach.de%2Fmysql-tutorial%2Fdaten-aktualisieren%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://www.php-einfach.de/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.php-einfach.de%2Fmysql-tutorial%2Fdaten-aktualisieren%2F&format=xml" />

<style type="text/css" id="custom-background-css">
body.custom-background { background-image: url("https://www.php-einfach.de/wp-content/themes/custom/images/background/patterns/pattern12.jpg"); background-position: left top; background-size: auto; background-repeat: repeat; background-attachment: scroll; }
</style>
<link rel="stylesheet" href="https://www.php-einfach.de/wp-content/themes/custom/style.css" media="screen" />
<link href='//fonts.googleapis.com/css?family=Philosopher:400,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="icon" type="image/vnd.microsoft.icon" href="https://www.php-einfach.de/wp-content/themes/custom/images/logo.ico">
<meta property="og:title" content="MySQL UPDATE - Daten aktualisieren - MySQL Tutorial - PHP & MySQL lernen" />
<meta property="og:site_name" content="MySQL UPDATE - Daten aktualisieren - MySQL Tutorial - PHP & MySQL lernen" />
<meta property="og:image" content="https://www.php-einfach.de/wp-content/themes/custom/images/logo_fb.png" />
<meta property="og:description" content="Mit dem Befehl UPDATE lassen sich in MySQL Daten einer Tabelle aktualisieren." />
</head>
<body class="page-template-default page page-id-341 page-child parent-pageid-7 custom-background custombody">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="47px" height="47px" viewBox="0 0 47 47" style="enable-background:new 0 0 47 47; display: none;" xml:space="preserve">
<g id="svg_logo" fill="#ffed9e">
<path d="M23.5,11.449c-6.385,0-11.563,4.959-11.563,11.077c0,7.265,5.045,9.117,5.045,13.344c0,1.045,0.799,2.017,1.999,2.731
			c-0.251,0.209-0.391,0.438-0.391,0.678c0,0.322,0.253,0.623,0.688,0.881c-0.408,0.253-0.645,0.544-0.645,0.855
			c0,0.314,0.242,0.608,0.659,0.863c-0.426,0.256-0.674,0.555-0.674,0.872c0,0.388,0.366,0.743,0.978,1.032
			c-0.237,0.215-0.373,0.453-0.373,0.703c0,0.74,1.153,1.369,2.774,1.621C22.282,46.634,22.86,47,23.534,47
			c0.673,0,1.25-0.363,1.535-0.889c1.637-0.248,2.803-0.881,2.803-1.623c0-0.247-0.131-0.482-0.363-0.694
			c0.625-0.291,0.998-0.651,0.998-1.042c0-0.314-0.241-0.609-0.659-0.863c0.425-0.257,0.674-0.554,0.674-0.871
			c0-0.322-0.254-0.623-0.688-0.882c0.41-0.252,0.646-0.544,0.646-0.855c0-0.249-0.151-0.484-0.421-0.698
			c1.181-0.713,1.966-1.675,1.966-2.711c0-4.229,5.039-6.08,5.039-13.344C35.063,16.408,29.886,11.449,23.5,11.449z M29.538,29.381
			c-1.152,1.692-2.455,3.604-2.535,6.232c-0.396,0.441-1.809,1.158-3.499,1.158c-1.691,0-3.105-0.717-3.5-1.16
			c-0.08-2.629-1.385-4.541-2.539-6.232c-1.287-1.886-2.502-3.667-2.502-6.854c0-4.439,3.83-8.051,8.537-8.051
			c4.708,0,8.538,3.612,8.538,8.051C32.038,25.713,30.823,27.495,29.538,29.381z" />
<path d="M23.5,7.564c0.832,0,1.513-0.9,1.513-2V2c0-1.1-0.681-2-1.513-2s-1.513,0.9-1.513,2v3.564
			C21.987,6.665,22.668,7.564,23.5,7.564z" />
<path d="M15.747,9.642c0.721-0.416,0.859-1.536,0.31-2.488l-1.781-3.087c-0.55-0.953-1.59-1.392-2.311-0.976
			c-0.721,0.416-0.86,1.536-0.311,2.488l1.783,3.087C13.987,9.619,15.026,10.058,15.747,9.642z" />
<path d="M9.095,13.007L6.01,11.225c-0.953-0.55-2.073-0.411-2.489,0.31c-0.416,0.721,0.022,1.76,0.976,2.31l3.086,1.782
			c0.953,0.55,2.073,0.411,2.488-0.31C10.486,14.596,10.048,13.557,9.095,13.007z" />
<path d="M42.504,32.295l-3.086-1.781c-0.953-0.551-2.073-0.412-2.488,0.31c-0.416,0.721,0.021,1.76,0.977,2.31l3.084,1.782
			c0.953,0.55,2.073,0.411,2.489-0.31C43.896,33.884,43.458,32.845,42.504,32.295z" />
<path d="M7.994,23.07c0-0.833-0.9-1.513-2-1.513H2.43c-1.1,0-2,0.681-2,1.513c0,0.832,0.9,1.513,2,1.513h3.564
			C7.094,24.583,7.994,23.902,7.994,23.07z" />
<path d="M44.57,21.557h-3.563c-1.101,0-2,0.681-2,1.513c0,0.832,0.899,1.513,2,1.513h3.563c1.101,0,2-0.681,2-1.513
			C46.57,22.238,45.67,21.557,44.57,21.557z" />
<path d="M7.582,30.514l-3.086,1.781c-0.953,0.55-1.392,1.589-0.976,2.311c0.416,0.721,1.536,0.859,2.489,0.31l3.085-1.782
			c0.953-0.55,1.392-1.589,0.976-2.31C9.655,30.104,8.535,29.963,7.582,30.514z" />
<path d="M39.418,15.627l3.086-1.782c0.953-0.55,1.392-1.589,0.976-2.31c-0.416-0.721-1.536-0.86-2.489-0.31l-3.085,1.782
			c-0.952,0.55-1.392,1.589-0.976,2.31C37.345,16.038,38.465,16.177,39.418,15.627z" />
<path d="M35.036,3.09c-0.722-0.416-1.762,0.023-2.312,0.976l-1.781,3.087c-0.55,0.953-0.411,2.072,0.31,2.488
			c0.722,0.416,1.761-0.023,2.311-0.976l1.783-3.087C35.896,4.626,35.756,3.506,35.036,3.09z" />
</g>
</svg>
<header id="header">
<div class="container">
<div class="row">
<div class="col-sm-4" style="padding-left: 0px;">
<div id="logo">
<a href="https://www.php-einfach.de" title="PHP lernen">
<svg width="47px" height="47px" viewbox="0 0 47 47" style="float:left; margin-right:10px;">
<use xlink:href="#svg_logo"></use>
</svg>
<span style="line-height:47px;">
PHP-Einfach.de</span>
</a>
</div>
</div>
<div class="col-sm-8" style="padding-right:0px; padding-left:0px;">
<nav id="mainmenu">
<ul id="menu-top-menue" class="menu l_tinynav1" style="padding-left:0px;">
<li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-33"><a href="https://www.php-einfach.de/php-tutorial/">PHP Tutorial</a></li>
<li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-object-page current-page-ancestor menu-item-34"><a href="https://www.php-einfach.de/mysql-tutorial/">MySQL Tutorial</a></li>
<li id="menu-item-51" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-51"><a href="https://www.php-einfach.de/experte/">Für Fortgeschrittene</a></li>
<li id="menu-item-1863" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1863"><a href="https://www.php-einfach.de/webhosting/">Webhosting</a></li>
<li id="menu-item-1674" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1674"><a target="_blank" rel="noopener noreferrer" href="http://jobs.php-einfach.de/">Jobs</a></li>
<li id="menu-item-56" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-56"><a target="_blank" rel="noopener noreferrer" href="https://www.php-support.de">Forum</a></li>
<li class="dropdown" id="search-dropdown">
<a id="search-dropdown-link" class="dropdown-toggle" href="https://www.php-einfach.de/?s=" title="Suche"><i class="fa fa-search" title="Suche"></i></a>
<div id="search-dropdown-form" class="dropdown-menu" style="right:0px;left:auto; padding-left:5px; width: 250px;">
<form role="search" method="get" id="searchform" class="searchform" action="https://www.php-einfach.de">
<div>
<input value="" name="s" id="search-query-input" type="text" style="width: 170px;">
<input id="searchsubmit" value="Suche" type="submit">
</div>
</form>
</div>
</li>
</ul>
<form style="margin:0;" action="https://www.php-einfach.de" method="get" onsubmit="top.location.href=jQuery('#page_id').val(); return false;">
<select class="tinynav" name="page_id" id="page_id" onchange="top.location.href=this.value"><option class="level-0" value="https://www.php-einfach.de">Home</option> <option class="level-0" value="https://www.php-einfach.de/php-tutorial/">PHP Tutorial</option>
<option class="level-0" value="https://www.php-einfach.de/mysql-tutorial/">MySQL Tutorial</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-installieren/">    MySQL installieren und starten</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/phpmyadmin-datenbank-verwalten/">    phpMyAdmin</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/verbindung-aufbauen/">    Datenbankverbindung aufbauen</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/daten-ausgeben/">    Simple Datenabfrage per SELECT</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/komplexere-datenabfrage/">    Komplexere Datenabfrage per SELECT</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/php-prepared-statements/">    Prepared Statements</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/daten-einfuegen/">    Daten einfügen per INSERT</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/daten-aktualisieren/" selected="selected">    Daten aktualisieren per UPDATE</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/daten-loeschen/">    Daten löschen mittels DELETE</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/gefundene-eintraege-zaehlen/">    Gefundene Einträge zählen mittels COUNT</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/datum-und-zeit/">    DATE-Datenbankspalten</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-datumfunktion-zeitfunktion/">    Datum- und Zeitfunktionen in MySQL</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-fehlermeldungen/">    MySQL Fehlermeldungen</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/datenbankverbindung-schliessen/">    Datenbankverbindung schließen</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-left-join/">    MySQL LEFT Join</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/optimierung-von-mysql-verwendung-des-index/">    Optimierung von MySQL: Verwendung des Index</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-normalformen/">    MySQL Normalformen</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/mysql-fremdschluessel/">    MySQL Fremdschlüssel</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/uebersicht-sql-befehle/">    Übersicht SQL-Befehle</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/crashkurs-mysql/">    Crashkurs MySQL</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/crashkurs-mysqli/">    Crashkurs MySQLi</option>
<option class="level-1" value="https://www.php-einfach.de/mysql-tutorial/crashkurs-pdo/">    Crashkurs PDO</option>
<option class="level-0" value="https://www.php-einfach.de/experte/">Für Fortgeschrittene</option>
<option class="level-0" value="https://www.php-einfach.de/webhosting/">Webhosting</option>
<option class="level-0" value="https://www.php-einfach.de/blog/">Blog</option>
<option class="level-0" value="http://jobs.php-einfach.de">Stellenmarkt</option><option class="level-0" value="https://www.php-support.de">Forum</option></select><noscript><input type="submit" name="submit" value="Go" /></noscript></form>
<script>
                 jQuery('#search-dropdown-link').click(function(e) {
                	 jQuery('#search-dropdown-form').toggle();

                	 if(jQuery('#search-dropdown-form').is(':visible')) {
                		 jQuery('#search-query-input').focus();
                	 }
                	 e.preventDefault();
                	
                 });
//                  jQuery('#suche-dropdown').on('shown.bs.dropdown', function () {		    
// 		        	  jQuery('#search-query-input').focus();
// 		        	});
		        </script>
</nav>
</div>
</div>
</div>
</header>
<div class="container content">
<div class="row">
<div class="col-sm-9 col-sm-push-3 left-sidebar">
<div class="pin-article">
<article class="article">
<h1 class="title"> Daten aktualisieren per UPDATE </h1>
<div class="entry-info">
<small class="author pull-right">10. Februar 2020</small>
<ol class="breadcrumbs" vocab="http://schema.org/" typeof="BreadcrumbList"><li property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" href="https://www.php-einfach.de"><span property="name">Home</span></a> <meta property="position" content="1"></li> » <li property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" href="https://www.php-einfach.de/mysql-tutorial/"><span property="name">MySQL Tutorial</span></a> <meta property="position" content="2"></li> » <li class="current-page" property="itemListElement" typeof="ListItem"><span property="name">Daten aktualisieren per UPDATE<meta property="position" content="3"></span></li></ol> </div>
<p>Daten lassen sich in MySQL aktualisieren mittels der <em>UPDATE</em>-Anweisung <a href="https://dev.mysql.com/doc/refman/5.0/en/update.html" target="_blank"><span class="fa fa-info-circle"></span></a>. Ähnlich wie bei <em>WHERE</em> können wir hier wieder die gleichen Anweisungen nutzen um zu spezifizieren, welche Einträge geändert werden sollen.</p>
<div class="toc_adsense hidden-xs">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

<ins class="adsbygoogle" style="display:inline-block;width:200px;height:200px" data-ad-client="ca-pub-5312478141737340" data-ad-slot="5736677238"></ins>
<script>
								(adsbygoogle = window.adsbygoogle || []).push({});
								</script>
</div><div id="toc_container" class="no_bullets"><p class="toc_title">Inhaltsverzeichnis</p><ul class="toc_list"><li><a href="#Update_einer_einzelnen_Zeile"><span class="toc_number toc_depth_1">1</span> Update einer einzelnen Zeile</a></li><li><a href="#Mehrere_Eintraege_aktualisieren"><span class="toc_number toc_depth_1">2</span> Mehrere Einträge aktualisieren</a></li><li><a href="#Mehrere_Felder_aktualisieren"><span class="toc_number toc_depth_1">3</span> Mehrere Felder aktualisieren</a></li><li><a href="#Auf_andere_Felder_verweisen"><span class="toc_number toc_depth_1">4</span> Auf andere Felder verweisen</a></li><li><a href="#Felder_inkrementieren"><span class="toc_number toc_depth_1">5</span> Felder inkrementieren</a></li><li><a href="#Felder_sortieren_und_Anzahl_der_Felder_begrenzen"><span class="toc_number toc_depth_1">6</span> Felder sortieren und Anzahl der Felder begrenzen</a></li></ul></div> <div style="clear: both;"></div>
<h2><span id="Update_einer_einzelnen_Zeile">Update einer einzelnen Zeile</span></h2>
<p>Möchte ihr eine einzelne Zeile in eurer Tabelle aktualisieren, so könnt ihr auf das Id-Feld zurückgreifen. Jeder Eintrag besitzt eine eindeutige Id, also könnt ihr ganz bewusst diesen Eintrag verändern:</p>
<div id="crayon-5e4ed373f0487012152211" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f0487012152211-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0487012152211-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f0487012152211-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0487012152211-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f0487012152211-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0487012152211-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f0487012152211-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0487012152211-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0487012152211-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0487012152211-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = ? WHERE id = ?"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0487012152211-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="08666d7d48786078256d61666e696b60266c6d">[email protected]</a>'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-cn">1</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0487012152211-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>In diesem Beispiel wird die Tabelle <em>users</em> aktualisiert. Dabei wird das Feld <em>email</em> aktualisiert auf einen noch zu bestimmenden Wert (deswegen der Platzhalter) und zwar für alle Einträge mit einer gewissen Id. Mittels <em>execute()</em> wird dieses <a href='https://www.php-einfach.de/mysql-tutorial/php-prepared-statements/'>prepared Statement</a> ausgeführt und es werden die konkreten Daten übergeben. In diesem Fall wird der Eintrag mit der Id 1 aktualisiert und für diesen wird die E-Mail-Adresse <em><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f29c9787b2829a82df979b9c9493919adc9697">[email protected]</a></em> gesetzt.</p>
<p>Natürlich könnt ihr die Parameter, wie bei allen prepared Statements, auch wieder benennen:</p>
<div id="crayon-5e4ed373f0495524628612" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f0495524628612-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0495524628612-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f0495524628612-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0495524628612-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f0495524628612-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0495524628612-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f0495524628612-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0495524628612-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0495524628612-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0495524628612-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = :email_neu WHERE id = :id"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0495524628612-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'id'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-cn">1</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c0209192c1c041c410905020a0d0f04420809">[email protected]</a>'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0495524628612-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>Im obigen Fall haben wir die Id als ein Parameter definiert. Natürlich können wir auch eine feste Id in den Query einspeichern, z.B. wenn wir stets den Eintrag mit der Id 1 verändern wollen:</p>
<div id="crayon-5e4ed373f0499413072924" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f0499413072924-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0499413072924-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f0499413072924-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0499413072924-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f0499413072924-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f0499413072924-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f0499413072924-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0499413072924-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0499413072924-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0499413072924-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = :email_neu WHERE id = 1"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f0499413072924-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8a6adbd88b8a0b8e5ada1a6aea9aba0e6acad">[email protected]</a>'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f0499413072924-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p><strong>Achtung:</strong> Sofern euer Update von Benutzereingaben abhängt, z.B. ihr wollt die E-Mail-Adresse eines Nutzers mit einer gewissen Id aktualisieren, dann solltet ihr diese Id stets als Parameter für <em>execute($data)</em> übergeben und es <strong>nicht</strong> in das SQL-Statement reinschreiben. Dies können Angreifer ausnutzen und so unter Umständen mittels SQL-Injections sensible Daten aus eurer Datenbank stehlen oder manipulieren.</p>
<h2><span id="Mehrere_Eintraege_aktualisieren">Mehrere Einträge aktualisieren</span></h2>
<p>Das definieren der <em>WHERE</em>-Klausel ist für <em>UPDATE</em> optional. Wenn ihr diese weglasst, dann werden alle Einträge aktualisiert. Um die Email aller Benutzer zu verändern, könnt ihr z.B. folgenden Befehl ausführen:</p>
<div id="crayon-5e4ed373f049b606324182" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f049b606324182-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049b606324182-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f049b606324182-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049b606324182-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f049b606324182-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049b606324182-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f049b606324182-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049b606324182-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049b606324182-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049b606324182-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = :email_neu"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049b606324182-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e58b8090a5958d95c8808c8b8384868dcb8180">[email protected]</a>'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049b606324182-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>In den meisten Fällen wollt ihr aber nur gewisse Einträge aktualisieren. Statt einem einzelnen Eintrag könnt ihr mittels der <em>WHERE</em>-Anweisung auch beliebige Kriterien vorgeben, welche Datensätze aktualisiert werden sollen. Um die E-Mail-Adressen von allen Einträgen mit Vorname <em>Max</em> zu aktualisieren, könnt ihr folgende Anweisung nutzen:</p>
<div id="crayon-5e4ed373f049d713957036" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f049d713957036-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049d713957036-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f049d713957036-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049d713957036-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f049d713957036-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049d713957036-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f049d713957036-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049d713957036-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049d713957036-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049d713957036-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = :email_neu WHERE vorname = :vorname"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049d713957036-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc929989bc8c948cd19995929a9d9f94d29899">[email protected]</a>'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'vorname'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Max'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049d713957036-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>Auch könnt ihr mittels <em>AND</em> und <em>OR</em> komplexere Abfragen zusammensetzen, identisch wie es im Artikel <a href='https://www.php-einfach.de/mysql-tutorial/komplexere-datenabfrage/'>Komplexere Datenabfrage per SELECT</a> beschrieben ist:</p>
<div id="crayon-5e4ed373f049f341317188" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f049f341317188-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049f341317188-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f049f341317188-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049f341317188-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f049f341317188-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f049f341317188-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f049f341317188-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049f341317188-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049f341317188-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049f341317188-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET email = :email_neu WHERE vorname = :vorname AND nachname = :nachname"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f049f341317188-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ff919a8abf8f978fd29a9691999e9c97d19b9a">[email protected]</a>'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'vorname'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Max'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'nachname'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Mustermann'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f049f341317188-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p></p>
<h2><span id="Mehrere_Felder_aktualisieren">Mehrere Felder aktualisieren</span></h2>
<p>Bisher wurde immer nur ein Feld aktualisieren. Um mehrere Felder zu aktualisieren, könnt ihr entweder mehrere SQL-Anweisungen schreiben, oder alles in eine. Dazu führt ihr im <em>SET</em>-Teil alle Spalten und Werte ein (per Komma getrennt), die ihr aktualisieren wollt.</p>
<div id="crayon-5e4ed373f04a1302163834" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f04a1302163834-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a1302163834-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f04a1302163834-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a1302163834-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f04a1302163834-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a1302163834-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f04a1302163834-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a1302163834-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a1302163834-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a1302163834-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET vorname = :vorname_neu, email = :email_neu, nachname = :nachname_neu WHERE id = :id"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a1302163834-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'id'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-cn">1</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'email_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d7378685d6d756d307874737b7c7e75337978">[email protected]</a>'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'vorname_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Neuer Vorname'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'nachname_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Neuer Nachname'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a1302163834-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p></p>
<h2><span id="Auf_andere_Felder_verweisen">Auf andere Felder verweisen</span></h2>
<p>In der <em>UPDATE</em>-Anweisung könnt ihr auf die Werte anderer Felder zugreifen, so kann man beispielsweise sehr einfach einem Feld den Wert eines anderen zuweisen. Auch lassen sich so die Werte eines Felds erhöhen. Möchte ihr z.B. die Anzahl der Logins von einem User erhöhen, so muss dieses Feld jeweils um den Wert 1 erhöht werden. Dies kann MySQL direkt für euch erledigen.</p>
<p>Im folgenden setzt ihr für den User 1 den Wert für <em>vorname</em> gleich dem Wert von <em>nachname</em>:</p>
<div id="crayon-5e4ed373f04a2211624973" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f04a2211624973-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a2211624973-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f04a2211624973-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a2211624973-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f04a2211624973-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a2211624973-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f04a2211624973-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a2211624973-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a2211624973-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a2211624973-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET vorname = nachname WHERE id = :id"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a2211624973-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'id'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-cn">1</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a2211624973-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>Dies ist in diesem Fall nicht besonders sinnvoll, aber es gibt häufig Fälle in denen das nützlich sein kann. Beispielsweise fügt ihr noch eine weitere Spalte in eure bestehende Tabelle ein, z.B. die E-Mail-Adresse bei der Registrierung (die aktuelle E-Mail Adresse kann sich ja verändern). Um dann für alle Einträge die bestehende E-Mail-Adresse zu übernehmen, könnt ihr folgende Anweisung ausführen:<br />
[code]<br />
UPDATE users SET email_registration=email<br />
[/code]</p>
<p>Schon wird für alle Benutzer der Wert in dem Feld <em>email_registration</em> gleich dem Wert der Spalte <em>email</em> gesetzt.</p>
<h2><span id="Felder_inkrementieren">Felder inkrementieren</span></h2>
<p>Es lassen sich in MySQL auch sehr einfach die Werte von Feldern erhöhen oder verkleinern. Möchtet ihr z.B. die Anzahl der Logins protokollieren, so müsst ihr einfach folgenden Befehl bei jedem Login ausführen:</p>
<div id="crayon-5e4ed373f04a4781343638" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f04a4781343638-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a4781343638-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f04a4781343638-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a4781343638-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f04a4781343638-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a4781343638-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f04a4781343638-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a4781343638-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a4781343638-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a4781343638-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET anzahl_logins = anzahl_logins+1 WHERE id = :id"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a4781343638-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'id'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-cn">1</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a4781343638-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p>Hier wird für den User 1 das Feld <em>anzahl_logins</em> aktualisiert, und zwar auf den Wert <em>anzahl_logins+1</em>. Das heißt, danach ist der Wert in dem Feld um 1 größer. Ihr könnt dort ziemlich beliebige mathematische Operationen durchführen, mit <em>anzahl_logins-1</em> würde der Wert immer kleiner werden, mit <em>anzahl_logins*2</em> würde sich der Wert verdoppeln und mit <em>anzahl_logins*anzahl_logins</em> würdet ihr das Quadrat berechnen.</p>
<h2><span id="Felder_sortieren_und_Anzahl_der_Felder_begrenzen">Felder sortieren und Anzahl der Felder begrenzen</span></h2>
<p>Identisch zu <em>SELECT</em>-Anweisungen können wir bei <em>UPDATE</em> ebenfalls <em>ORDER BY</em> und <em>LIMIT</em> verwenden. Möchten wir beispielsweise die Benutzer mit den 10 kleinsten IDs aktualisieren, geht dies wie folgt:</p>
<div id="crayon-5e4ed373f04a6157566330" class="crayon-syntax crayon-theme-nils crayon-font-consolas crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover wrap" style=" margin-top: 12px; margin-bottom: 12px; font-size: 14px !important; line-height: 15px !important;">
<div class="crayon-main" style="">
<table class="crayon-table">
<tr class="crayon-row">
<td class="crayon-nums " data-settings="show">
<div class="crayon-nums-content" style="font-size: 14px !important; line-height: 15px !important;"><div class="crayon-num" data-line="crayon-5e4ed373f04a6157566330-1">1</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a6157566330-2">2</div><div class="crayon-num" data-line="crayon-5e4ed373f04a6157566330-3">3</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a6157566330-4">4</div><div class="crayon-num" data-line="crayon-5e4ed373f04a6157566330-5">5</div><div class="crayon-num crayon-striped-num" data-line="crayon-5e4ed373f04a6157566330-6">6</div></div>
</td>
<td class="crayon-code"><div class="crayon-pre" style="font-size: 14px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5e4ed373f04a6157566330-1"><span class="crayon-ta"><?php</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a6157566330-2"><span class="crayon-v">$pdo</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-r">new</span><span class="crayon-h"> </span><span class="crayon-e">PDO</span><span class="crayon-sy">(</span><span class="crayon-s">'mysql:host=localhost;dbname=test'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'username'</span><span class="crayon-sy">,</span><span class="crayon-h"> </span><span class="crayon-s">'password'</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a6157566330-3"> </div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a6157566330-4"><span class="crayon-v">$statement</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$pdo</span><span class="crayon-o">-></span><span class="crayon-e">prepare</span><span class="crayon-sy">(</span><span class="crayon-s">"UPDATE users SET vorname = :vorname_neu ORDER BY id LIMIT 10"</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-5e4ed373f04a6157566330-5"><span class="crayon-v">$statement</span><span class="crayon-o">-></span><span class="crayon-e">execute</span><span class="crayon-sy">(</span><span class="crayon-t">array</span><span class="crayon-sy">(</span><span class="crayon-s">'vorname_neu'</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-o">></span><span class="crayon-h"> </span><span class="crayon-s">'Neuer Vorname'</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-5e4ed373f04a6157566330-6"><span class="crayon-ta">?></span></div></div></td>
</tr>
</table>
</div>
</div><p></p>
<small class="author pull-right">Autor: <a href="https://www.php-einfach.de/author/nils/" title="Beiträge von Nils Reimers" rel="author">Nils Reimers</a></small>
<div class="clear"></div>
<section class="comment-form">
 <div class="clear"></div>
</section>
</article>
<div class="bottom_navigation">
<div class="alignleft">
<a href="https://www.php-einfach.de/mysql-tutorial/daten-einfuegen/" title="Daten einfügen per INSERT">Zurück: Daten einfügen per INSERT</a>
</div>
<div class="alignright">
<a href="https://www.php-einfach.de/mysql-tutorial/daten-loeschen/" title="Daten löschen mittels DELETE">Weiter: Daten löschen mittels DELETE</a>
</div>
</div>
<hr style="border-color: #ccc;">
<div class="bottom_navigation">
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5312478141737340" data-ad-slot="7168528034" data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</div>
<section id="sidebar" class="col-sm-3 col-sm-pull-9">
<div class="row">
<div class="pin-article"><div class="article"><h3 class="title"><a href="https://www.php-einfach.de/mysql-tutorial/">MySQL Tutorial</a>
</h3>
<ul>
<li class="page_item page-item-18"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-installieren/" title="MySQL installieren und starten">MySQL installieren und starten</a></li>
<li class="page_item page-item-60"><a href="https://www.php-einfach.de/mysql-tutorial/phpmyadmin-datenbank-verwalten/" title="phpMyAdmin">phpMyAdmin</a></li>
<li class="page_item page-item-64"><a href="https://www.php-einfach.de/mysql-tutorial/verbindung-aufbauen/" title="Datenbankverbindung aufbauen">Verbindung aufbauen</a></li>
<li class="page_item page-item-72"><a href="https://www.php-einfach.de/mysql-tutorial/daten-ausgeben/" title="Simple Datenabfrage per SELECT">Simple Datenabfrage</a></li>
<li class="page_item page-item-337"><a href="https://www.php-einfach.de/mysql-tutorial/komplexere-datenabfrage/" title="Komplexere Datenabfrage per SELECT">Komplexere Datenabfrage</a></li>
<li class="page_item page-item-501"><a href="https://www.php-einfach.de/mysql-tutorial/php-prepared-statements/" title="Prepared Statements">Prepared Statements</a></li>
<li class="page_item page-item-339"><a href="https://www.php-einfach.de/mysql-tutorial/daten-einfuegen/" title="Daten einfügen per INSERT">Daten einfügen</a></li>
<li class="page_item page-item-341 current_page_item"><a href="https://www.php-einfach.de/mysql-tutorial/daten-aktualisieren/" title="Daten aktualisieren per UPDATE">Daten aktualisieren</a></li>
<li class="page_item page-item-343"><a href="https://www.php-einfach.de/mysql-tutorial/daten-loeschen/" title="Daten löschen mittels DELETE">Daten löschen</a></li>
<li class="page_item page-item-345"><a href="https://www.php-einfach.de/mysql-tutorial/gefundene-eintraege-zaehlen/" title="Gefundene Einträge zählen mittels COUNT">Gefundene Einträge zählen</a></li>
<li class="page_item page-item-430"><a href="https://www.php-einfach.de/mysql-tutorial/datum-und-zeit/" title="DATE-Datenbankspalten">DATE-Datenbankspalten</a></li>
<li class="page_item page-item-596"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-datumfunktion-zeitfunktion/" title="Datum- und Zeitfunktionen in MySQL">Datum- und Zeitfunktionen</a></li>
<li class="page_item page-item-347"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-fehlermeldungen/" title="MySQL Fehlermeldungen">MySQL Fehlermeldungen</a></li>
<li class="page_item page-item-901"><a href="https://www.php-einfach.de/mysql-tutorial/datenbankverbindung-schliessen/" title="Datenbankverbindung schließen">Datenbankverbindung schließen</a></li>
<li class="page_item page-item-1323"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-left-join/" title="MySQL LEFT Join">JOIN</a></li>
<li class="page_item page-item-1315"><a href="https://www.php-einfach.de/mysql-tutorial/optimierung-von-mysql-verwendung-des-index/" title="Optimierung von MySQL: Verwendung des Index">Indizes</a></li>
<li class="page_item page-item-1364"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-normalformen/" title="MySQL Normalformen">Normalformen</a></li>
<li class="page_item page-item-1362"><a href="https://www.php-einfach.de/mysql-tutorial/mysql-fremdschluessel/" title="MySQL Fremdschlüssel">Fremdschlüssel</a></li>
<li class="page_item page-item-413"><a href="https://www.php-einfach.de/mysql-tutorial/uebersicht-sql-befehle/" title="Übersicht SQL-Befehle">Übersicht SQL-Befehle</a></li>
<li class="page_item page-item-371"><a href="https://www.php-einfach.de/mysql-tutorial/crashkurs-mysql/" title="Crashkurs MySQL">Crashkurs MySQL</a></li>
<li class="page_item page-item-373"><a href="https://www.php-einfach.de/mysql-tutorial/crashkurs-mysqli/" title="Crashkurs MySQLi">Crashkurs MySQLi</a></li>
<li class="page_item page-item-375"><a href="https://www.php-einfach.de/mysql-tutorial/crashkurs-pdo/" title="Crashkurs PDO">Crashkurs PDO</a></li>
</ul></div></div><div class="pin-article"><div class="article"> <div class="textwidget"><div>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5312478141737340" data-ad-slot="3884825230" data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<span>Mit freundlicher Unterstützung von:</span>
<ul style="list-style: outside disc; padding-left: 30px;">
<li style="line-height: 1em; border: 0px;"><a href="https://www.spar-lotse.de/strompreisvergleich/" rel="noopener noreferrer" target="_blank" title="Stromvergleich: Jetzt Stromanbieter wechseln und sparen">Stromvergleich bei Spar-Lotse.de</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://casinopilot24.com/" rel="noopener noreferrer" target="_blank">Casinopilot24.com</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://www.bonus.com.de/casino" rel="noopener noreferrer" target="_blank">BonusFinder Deutschland</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://www.onlinecasinoechtgeld.com/" rel="noopener noreferrer" target="_blank">Online casino echtgeld.com</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://www.neueonline-casinos.com/" rel="noopener noreferrer" target="_blank">Neueonline-Casinos.com</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://casinohex.at/online-casinos/" rel="noopener noreferrer" target="_blank">CasinoHEX.at</a></li>
<li style="line-height: 1em; border: 0px;"><a href="https://www.casinorella.com/de/" rel="noopener noreferrer" target="_blank">Casinorella.com</a></li>
</ul></div>
</div></div><div class="pin-article"><div class="article"><h3 class="title"><a href="https://www.php-einfach.de/webhosting/">Hoster – Geringste Ausfallzeit</a></h3><ol class="webhoster-ranking-widget"><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/webgo/">webgo</a>
<span class="pull-right" title="Ø 11 Minuten Ausfallzeit je Monat">Ø 11 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/mittwald/">Mittwald</a>
<span class="pull-right" title="Ø 12 Minuten Ausfallzeit je Monat">Ø 12 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/linevast/">Linevast</a>
<span class="pull-right" title="Ø 17 Minuten Ausfallzeit je Monat">Ø 17 Min.</span>
</li><li><a href="/webhosting/webhosting-vergleich/manitu/">manitu</a>
<span class="pull-right" title="Ø 20 Minuten Ausfallzeit je Monat">Ø 20 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/1und1/">1&1</a>
<span class="pull-right" title="Ø 22 Minuten Ausfallzeit je Monat">Ø 22 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/dogado/">dogado</a>
<span class="pull-right" title="Ø 29 Minuten Ausfallzeit je Monat">Ø 29 Min.</span>
</li><li><a href="/webhosting/webhosting-vergleich/alfahosting/">Alfahosting</a>
<span class="pull-right" title="Ø 32 Minuten Ausfallzeit je Monat">Ø 32 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/host-europe/">Host Europe</a>
<span class="pull-right" title="Ø 35 Minuten Ausfallzeit je Monat">Ø 35 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/one-com/">ONE.com</a>
<span class="pull-right" title="Ø 38 Minuten Ausfallzeit je Monat">Ø 38 Min.</span>
</li><li><a href="//www.webhosterwissen.de/webhosting/webhosting-vergleich/all-inkl-com/">All-Inkl.com</a>
<span class="pull-right" title="Ø 43 Minuten Ausfallzeit je Monat">Ø 43 Min.</span>
</li></ol><center><a href="https://www.php-einfach.de/webhosting/">» Mehr erfahren</a></center></div></div>
</div>
</section>
</div>
</div>
<footer id="footer">
<div class="container">
<div class="row">
<div class="col-sm-6 copyright">
<p><a href="https://www.php-einfach.de/impressum/">Impressum</a> | <a href="https://www.php-einfach.de/datenschutz/">Datenschutz</a> | <a href="https://www.php-einfach.de/ihre-werbung/">Auf PHP-Einfach.de werben</a></p>
</div>
<div class="col-sm-6 copyright" style="text-align:right;">
<p>© PHP-Einfach.de 2003 - 2020 </p>
</div>
</div>
</div>
</footer>
<div id="back-to-top">
<a href="#top" style=""><i class="fa fa-caret-up"></i></a>
</div>
<div id="cookie-law-info-bar"><span>Um dich beim Lernen von PHP und MySQL zu unterstützen verwenden wir Cookies. <a href="#" id="cookie_action_close_header" class="cli-plugin-main-button">OK</a> <a href="https://www.php-einfach.de/datenschutz/" id="CONSTANT_OPEN_URL" target="_blank" class="cli-plugin-main-link">Weitere Infos</a></span></div>
<script type="text/javascript">
			//<![CDATA[
			jQuery(document).ready(function() {
				cli_show_cookiebar({
					settings: '{"animate_speed_hide":"500","animate_speed_show":"500","background":"#fff","border":"#444","border_on":false,"button_1_button_colour":"#000","button_1_button_hover":"#000000","button_1_link_colour":"#1b87a4","button_1_as_button":false,"button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#1b87a4","button_2_as_button":false,"button_3_button_colour":"#000","button_3_button_hover":"#000000","button_3_link_colour":"#fff","button_3_as_button":true,"font_family":"inherit","header_fix":false,"notify_animate_hide":true,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"accept_close_reload":false,"showagain_tab":false,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#000","show_once_yn":true,"show_once":"10000"}'
				});
			});
			//]]>
		</script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/comment-reply.min.js?ver=5.3.2'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var tocplus = {"visibility_show":"Anzeigen","visibility_hide":"Verbergen","width":"Auto"};
/* ]]> */
</script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-content/plugins/table-of-contents-plus/front.min.js?ver=1509'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.4'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/jquery/ui/tabs.min.js?ver=1.11.4'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-content/themes/custom/js/jquery.wip.js?ver=5.3.2'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var newsletter = {"messages":{"email_error":"Bitte g\u00fcltige E-Mail-Adresse eingeben","name_error":"Der Name ist fehlerhaft","surname_error":"The last name is not correct","profile_error":"","privacy_error":"You must accept the privacy statement"},"profile_max":"20"};
/* ]]> */
</script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-content/plugins/newsletter/subscription/validate.js?ver=5.7.4'></script>
<script type='text/javascript' defer='defer' src='https://www.php-einfach.de/wp-includes/js/wp-embed.min.js?ver=5.3.2'></script>
<img src="https://vg04.met.vgwort.de/na/1cb9f761191b40708b928f5b9e1a565b" width="1" height="1" alt="" style="display:none" />
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-2653685-1', 'auto');
  ga('send', 'pageview');

</script>
</body>
</html>

HEADER-CODE:


HTTP/1.1 200 OK
Date: Mon, 18 May 2020 12:57:27 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Set-Cookie: __cfduid=dc0c01eb46c66872f005c043f60d5ef571589806647; expires=Wed, 17-Jun-20 12:57:27 GMT; path=/; domain=.php-einfach.de; HttpOnly; SameSite=Lax
Link: ; rel="https://api.w.org/", ; rel=shortlink
Vary: Accept-Encoding
Last-Modified: Mon, 18 May 2020 08:30:33 GMT
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5955be7d49c7d6e1-FRA
cf-request-id: 02c975624f0000d6e13b2ad200000001

IP 104.31.75.223 www.php-einfach.de

Website:www.php-einfach.de
IP:104.31.75.223
County:US United States
Region:VA Virginia
City:20149 Ashburn
Timezone:America/New_York
html
html5
CSS
CSS3
CSS GRID
Java
Berliner Luft- und Badeparadies – Wikipedia | AGB - Tyork | PHP DOM - counting child nodes? - Stack Overflow | https://www.facebook.com/MISKEEN-ORIGINALS-CLOTHING-99675687923/ | Kaynaklar, Sport climbing | theCrag | SASFAA - Home | SMARTSTUFF FURNITURE - Bellini Baby and Teen Furniture | https://openei.org/wiki/Emission_Factors_%28EMFAC%29 | Feitosa Karte - Ponte de Lima, Portugal - Mapcarta | Herrig - Stadt Erftstadt | Uniconta | Unipedia – help and guidance with Uniconta | Uniconta | https://www.elypso.de/ | Isensee / Kirchhof (Hrsg.) | Handbuch des Staatsrechts der Bundesrepublik Deutschland, Band VIII: Grundrechte: Wirtschaft, Verfahren, Gleichheit | 3., völlig neu bearbeitete und erweiterte Auflage 2010 | 2010 | Vesnina E. Mertens E. Live Ticker und Live Stream - SofaScore | Gruul - Hearthstone Wiki | Jones Soda Co.