{"id":67,"date":"2013-12-06T19:50:05","date_gmt":"2013-12-06T19:56:33","guid":{"rendered":"https:\/\/cf06ephpmysql.jpg"},"modified":"2015-07-16T19:07:11","modified_gmt":"2015-07-17T01:07:11","slug":"conectar-php-con-mysql","status":"publish","type":"post","link":"https:\/\/emanuelpaxtian.com\/blog\/conectar-php-con-mysql\/","title":{"rendered":"Conectar php con mysql"},"content":{"rendered":"<p>Ejemplo sencillo de conexi\u00f3n a mysql desde php en caso de establecer conexi\u00f3n manda un mensaje satisfactorio o de lo contrario informa del error<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n            $server=&quot;localhost&quot;;\r\n            $user=&quot;root&quot;;\r\n            $password=&quot;123&quot;;\r\n            $database=&quot;prueba&quot;;\r\n            $cn=mysql_connect($server, $user, $password) or die(&quot;Error al concetar al servidor mysql:&quot;.mysql_error());\r\n            $db=mysql_select_db($database,$cn) or die(&quot;Error al conectar a la base de datos:&quot;.mysql_error());\r\n            if($db)\r\n                echo &quot;Conexi&amp;oacute;n satisfactoria&quot;;\r\n            else\r\n                echo &quot;No conecto a la Base de Datos&quot;;\r\n        ?&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ejemplo sencillo de conexi\u00f3n a mysql desde php en caso de establecer conexi\u00f3n manda un mensaje satisfactorio o de lo contrario informa del error &lt;?php $server=&quot;localhost&quot;; $user=&quot;root&quot;; $password=&quot;123&quot;; $database=&quot;prueba&quot;; $cn=mysql_connect($server,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":627,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":0,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media\/627"}],"wp:attachment":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}