{"id":325,"date":"2013-08-09T01:05:44","date_gmt":"2013-08-09T01:05:44","guid":{"rendered":"http:\/\/speedwebdesigner.com\/?p=325"},"modified":"2013-08-09T01:06:58","modified_gmt":"2013-08-09T01:06:58","slug":"erro-mysql_fetch_assoc-expects-parameter-1-to-be-resource","status":"publish","type":"post","link":"https:\/\/speedwebdesigner.net\/en\/noticias\/dicas\/erro-mysql_fetch_assoc-expects-parameter-1-to-be-resource\/325\/","title":{"rendered":"ERROR: mysql_fetch_assoc() expects parameter 1 to be resource"},"content":{"rendered":"<p><a href=\"http:\/\/speedwebdesigner.com\/wp-content\/uploads\/2013\/08\/Mysql-logo.gif\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-326\" alt=\"Mysql-logo\" src=\"http:\/\/speedwebdesigner.com\/wp-content\/uploads\/2013\/08\/Mysql-logo.gif\" width=\"300\" height=\"167\" \/><\/a><\/p>\n<p>The mistake &quot;<em><strong>mysql_fetch_assoc() expects parameter 1 to be resource\u201d <\/strong><\/em>may is associated with several factors with which PHP will access the Database, to identify the specific error use the following command.<\/p>\n<p><strong>Ex:<\/strong> Solution to Identify Query Specific Error<\/p>\n<pre><code>\r\n$query = &quot;SELECT *...&quot;; $query = mysql_query($query); if (!$query) { die(mysql_error()); }\r\n\r\n\u00a0<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>The error \u201cmysql_fetch_assoc() expects parameter 1 to be resource\u201d can be associated with several factors with which PHP will access the Database, to identify the specific error use the following command. Ex: Solution to identify the specific error of the query $query = \u201cSELECT *\u2026\u201d; $query = mysql_query($query); if (!$query) { die(mysql_error()); }\u2026<\/p>","protected":false},"author":1,"featured_media":326,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[146],"tags":[],"class_list":["post-325","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dicas"],"_links":{"self":[{"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":2,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/posts\/325\/revisions\/328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/media\/326"}],"wp:attachment":[{"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/speedwebdesigner.net\/en\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}