{"id":13,"date":"2016-08-02T07:40:47","date_gmt":"2016-08-02T07:40:47","guid":{"rendered":"http:\/\/10.0.3.2\/wordpress\/?p=13"},"modified":"2018-01-09T04:56:09","modified_gmt":"2018-01-09T04:56:09","slug":"sql-vs-php-object-oriented-connection","status":"publish","type":"post","link":"https:\/\/info.juliusgoh.life\/?p=13","title":{"rendered":"SQL VS PHP (Object oriented connection)"},"content":{"rendered":"<p><strong>HOW TO ESTABLISH THE CONNECTION WITH DATABASE<\/strong><\/p>\n<p>$db = new mysqli(&lt;HOST NAME&gt;,&lt;DB USER&gt;,&lt;DB PASS&gt;,&lt;DB NAME&gt;);<\/p>\n<p><strong>HOW TO EXECUTE QUERY<\/strong><\/p>\n<p>$query = &#8220;YOUR QUERY&#8221;;<\/p>\n<p>$result = $db-&gt;query($query);<\/p>\n<p><strong>HOW TO LIST YOUR QUERY RESULT<\/strong><\/p>\n<p>while($row = $result-&gt;fetch_array(MYSQLI_ASSOC)){<\/p>\n<p>echo &#8220;Hi &#8221; .$row[&#8216;Name&#8217;]. &#8220;, Your Email is&#8221; .$row[&#8216;Email&#8217;]. &#8221; and your phone number is &#8221; .$row[&#8216;Phone&#8217;] ;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HOW TO ESTABLISH THE CONNECTION WITH DATABASE $db = new mysqli(&lt;HOST NAME&gt;,&lt;DB USER&gt;,&lt;DB PASS&gt;,&lt;DB NAME&gt;); HOW TO EXECUTE QUERY $query = &#8220;YOUR QUERY&#8221;; $result = $db-&gt;query($query); HOW TO LIST YOUR QUERY RESULT while($row = $result-&gt;fetch_array(MYSQLI_ASSOC)){ echo &#8220;Hi &#8221; .$row[&#8216;Name&#8217;]. &#8220;, Your Email is&#8221; .$row[&#8216;Email&#8217;]. &#8221; and your phone number is &#8221; .$row[&#8216;Phone&#8217;] ; }<\/p>\n","protected":false},"author":1,"featured_media":242,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"footnotes":""},"categories":[3,4],"tags":[],"_links":{"self":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/13"}],"collection":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":1,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions\/243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/media\/242"}],"wp:attachment":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}