{"id":108,"date":"2008-02-12T15:57:19","date_gmt":"2008-02-12T13:57:19","guid":{"rendered":"http:\/\/www.hermione.de\/blog\/?p=108"},"modified":"2008-05-12T16:07:20","modified_gmt":"2008-05-12T14:07:20","slug":"php-mysql-funktionen","status":"publish","type":"post","link":"http:\/\/blog.hermione.de\/?p=108","title":{"rendered":"php mysql funktionen"},"content":{"rendered":"<h4>connect, query und disconnect<\/h4>\n<table class=\"rosa\">\n<tr>\n<td>\n<pre><code>\/\/connect\r\n$dbh = mysql_connect($database,$username,$password);\r\nif (!$dbh) {\r\n   die(\"no db connect \" . $mysql_error());\r\n}\r\n\r\n\/\/select database\r\nmysql_select_db($database, $dbh);\r\n\r\n\/\/ mysql_query\r\n$mysql_query = \"SELECT date,titel FROM posts WHERE id=$id\";\r\n$rv = mysql_query($mysql_query, $dbh);\r\n\r\n<strong>\/\/ mysql_fetch_row<\/strong>\r\nwhile ($row = mysql_fetch_row($rv)) {\r\n\r\n   $myDate = $row[0];\r\n   $myTitel  = $row[1];\r\n}\r\n<strong>\/\/mysql_fetch_assoc<\/strong>\r\nwhile ($row = mysql_fetch_assoc($rv)) {\r\n   $myDate = $row[\"date\"];\r\n   $myTitel  = $tow[\"titel\"];\r\n}\r\n\r\n\/\/disconnect\r\nmysql_close($dbh);<\/code>\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<h4>links<\/h4>\n<p><a href=\"http:\/\/www.php.net\/manual\/de\/ref.mysql.php\">RTFM<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>connect, query und disconnect \/\/connect $dbh = mysql_connect($database,$username,$password); if (!$dbh) { die(&#8222;no db connect &#8220; . $mysql_error()); } \/\/select database mysql_select_db($database, $dbh); \/\/ mysql_query $mysql_query = &#8222;SELECT date,titel FROM posts WHERE id=$id&#8220;; $rv = mysql_query($mysql_query, $dbh); \/\/ mysql_fetch_row while ($row = mysql_fetch_row($rv)) { $myDate = $row[0]; $myTitel = $row[1]; } \/\/mysql_fetch_assoc while ($row = mysql_fetch_assoc($rv)) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/108"}],"collection":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=108"}],"version-history":[{"count":0,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}