{"id":4453,"date":"2012-05-25T08:33:02","date_gmt":"2012-05-25T08:33:02","guid":{"rendered":"http:\/\/phpcodez.com\/?p=4453"},"modified":"2012-05-25T08:33:02","modified_gmt":"2012-05-25T08:33:02","slug":"mysql_query","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/mysql_query\/","title":{"rendered":"mysql_query()"},"content":{"rendered":"<p>It executes a query on a MySQL database<\/p>\n<p><strong>MySQL Table &#8211; Users<\/strong><br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| id | name |<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| \u00a01 | PHP \u00a0|<br \/>\n| \u00a02 | ASP \u00a0|<br \/>\n| \u00a03 | JSP \u00a0|<br \/>\n| \u00a04 | JS \u00a0|<br \/>\n| \u00a05 | AS \u00a0|<br \/>\n+&#8212;-+&#8212;&#8212;+<\/p>\n<p><strong>Example<\/strong><br \/>\n&lt;?php<br \/>\nmysql_pconnect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error());<br \/>\n$db_selected = mysql_select_db(&#8220;database_name&#8221;);<br \/>\necho mysql_num_rows(mysql_query( &#8220;SELECT * FROM users&#8221;));<br \/>\nmysql_close();<br \/>\n?&gt;<\/p>\n<p><strong>Output<\/strong><br \/>\n5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It executes a query on a MySQL database MySQL Table &#8211; Users +&#8212;-+&#8212;&#8212;+ | id | name | +&#8212;-+&#8212;&#8212;+ | \u00a01 | PHP \u00a0| | \u00a02 | ASP \u00a0| | \u00a03 | JSP \u00a0| | \u00a04 | JS \u00a0| | \u00a05 | AS \u00a0| +&#8212;-+&#8212;&#8212;+ Example &lt;?php mysql_pconnect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error()); $db_selected = mysql_select_db(&#8220;database_name&#8221;); &hellip; <a href=\"http:\/\/phpcodez.com\/mysql_query\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">mysql_query()<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[213,332,370],"class_list":["post-4453","post","type-post","status-publish","format-standard","hentry","category-php","tag-functions","tag-mysql","tag-php"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=4453"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4453\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=4453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=4453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=4453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}