{"id":7114,"date":"2022-03-18T15:19:11","date_gmt":"2022-03-18T06:19:11","guid":{"rendered":"https:\/\/www.auctionpro.co.kr\/?p=7114"},"modified":"2024-02-29T14:48:08","modified_gmt":"2024-02-29T05:48:08","slug":"php-echo-xml-%ed%98%95%ec%8b%9d%ec%9c%bc%eb%a1%9c-%ec%b6%9c%eb%a0%a5","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=7114","title":{"rendered":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Remark : \uc6f9\ud654\uba74\uc5d0 XML \ud615\uc2dd\uc73c\ub85c \ub098\uc624\uae30 \ud558\uae30 <\/h4>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"xml\" >&lt;?php\n\/\/ Database configuration\n$host     = \"localhost\";  \/\/ Your database host\n$username = \"username\";   \/\/ Your database username\n$password = \"password\";   \/\/ Your database password\n$dbname   = \"database\";   \/\/ Your database name\n$table    = \"table\";      \/\/ Your database table\n\n\/\/ Create a new connection to the MySQL database\n$mysqli = new mysqli($host, $username, $password, $dbname);\n\n\/\/ Check for any connection errors\nif ($mysqli-&gt;connect_error) {\n    die(\"Connection failed: \" . $mysqli-&gt;connect_error);\n}\n\n\/\/ SQL query to select data from the table\n$query = \"SELECT * FROM $table\";\n$result = $mysqli-&gt;query($query);\n\n\/\/ Check if there are any rows returned\nif ($result-&gt;num_rows &gt; 0) {\n    \/\/ Start XML file, echo parent node\n    echo \"&lt;?xml version='1.0' encoding='UTF-8'?&gt;\";\n    echo \"&lt;root&gt;\";\n\n    \/\/ Iterate through the rows in the result set\n    while($row = $result-&gt;fetch_assoc()) {\n        echo \"&lt;item&gt;\";\n        echo \"&lt;id&gt;\" . $row[\"id\"] . \"&lt;\/id&gt;\";\n        echo \"&lt;name&gt;\" . htmlspecialchars($row[\"name\"]) . \"&lt;\/name&gt;\";\n        \/\/ Add more fields as needed\n        echo \"&lt;\/item&gt;\";\n    }\n\n    echo \"&lt;\/root&gt;\";\n} else {\n    echo \"0 results\";\n}\n\n\/\/ Close the database connection\n$mysqli-&gt;close();\n?&gt;<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:php decode:true \">header('Content-type: text\/xml'); \/\/xml type out\necho $return;<\/pre><\/div>\n\n\n\n<p>\uc18c\uc2a4\uc0c1\uc5d0 echo \ub0b4\uc6a9\uc5d0 \ub2e8\uc9c0 xml \ud615\uc2dd\ub9cc \uc788\uc5b4\uc57c \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png\"><img loading=\"lazy\" decoding=\"async\" width=\"923\" height=\"633\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png\" alt=\"\" class=\"wp-image-7115\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png 923w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP-300x206.png 300w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP-768x527.png 768w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP-150x103.png 150w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP-400x274.png 400w\" sizes=\"auto, (max-width: 923px) 100vw, 923px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Json \uc73c\ub85c \ucd9c\ub825<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"Json\" >&lt;?php\n\/\/ Database configuration\n$host     = \"localhost\";  \/\/ Your database host\n$username = \"username\";   \/\/ Your database username\n$password = \"password\";   \/\/ Your database password\n$dbname   = \"database\";   \/\/ Your database name\n$table    = \"table\";      \/\/ Your database table\n\n\/\/ Create a connection to the MySQL database\n$mysqli = new mysqli($host, $username, $password, $dbname);\n\n\/\/ Check for any connection errors\nif ($mysqli-&gt;connect_error) {\n    die(\"Connection failed: \" . $mysqli-&gt;connect_error);\n}\n\n\/\/ SQL query to select data from the table\n$query = \"SELECT * FROM $table\";\n$result = $mysqli-&gt;query($query);\n\n$data = array();\nif ($result-&gt;num_rows &gt; 0) {\n    \/\/ Fetch each row in the result set\n    while($row = $result-&gt;fetch_assoc()) {\n        $data[] = $row;\n    }\n} else {\n    echo \"0 results\";\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Remark : \uc6f9\ud654\uba74\uc5d0 XML \ud615\uc2dd\uc73c\ub85c \ub098\uc624\uae30 \ud558\uae30 \uc18c\uc2a4\uc0c1\uc5d0 echo \ub0b4\uc6a9\uc5d0 \ub2e8\uc9c0 xml \ud615\uc2dd\ub9cc \uc788\uc5b4\uc57c \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825. Json \uc73c\ub85c \ucd9c\ub825<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[43],"tags":[],"class_list":["post-7114","post","type-post","status-publish","format-standard","hentry","category-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.auctionpro.co.kr\/?p=7114\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro\" \/>\n<meta property=\"og:description\" content=\"Remark : \uc6f9\ud654\uba74\uc5d0 XML \ud615\uc2dd\uc73c\ub85c \ub098\uc624\uae30 \ud558\uae30 \uc18c\uc2a4\uc0c1\uc5d0 echo \ub0b4\uc6a9\uc5d0 \ub2e8\uc9c0 xml \ud615\uc2dd\ub9cc \uc788\uc5b4\uc57c \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825. Json \uc73c\ub85c \ucd9c\ub825\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.auctionpro.co.kr\/?p=7114\" \/>\n<meta property=\"og:site_name\" content=\"AuctionPro\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-18T06:19:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-29T05:48:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png\" \/>\n\t<meta property=\"og:image:width\" content=\"923\" \/>\n\t<meta property=\"og:image:height\" content=\"633\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"golgol\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"golgol\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114\"},\"author\":{\"name\":\"golgol\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"headline\":\"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825\",\"datePublished\":\"2022-03-18T06:19:11+00:00\",\"dateModified\":\"2024-02-29T05:48:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114\"},\"wordCount\":8,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Soap_PHP.png\",\"articleSection\":[\"[Dev]PHP\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114\",\"name\":\"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Soap_PHP.png\",\"datePublished\":\"2022-03-18T06:19:11+00:00\",\"dateModified\":\"2024-02-29T05:48:08+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#primaryimage\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Soap_PHP.png\",\"contentUrl\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Soap_PHP.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=7114#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\",\"name\":\"AuctionPro\",\"description\":\"\uc625\uc158\ud504\ub85c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\",\"name\":\"golgol\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?author=6\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.auctionpro.co.kr\/?p=7114","og_locale":"ko_KR","og_type":"article","og_title":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro","og_description":"Remark : \uc6f9\ud654\uba74\uc5d0 XML \ud615\uc2dd\uc73c\ub85c \ub098\uc624\uae30 \ud558\uae30 \uc18c\uc2a4\uc0c1\uc5d0 echo \ub0b4\uc6a9\uc5d0 \ub2e8\uc9c0 xml \ud615\uc2dd\ub9cc \uc788\uc5b4\uc57c \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825. Json \uc73c\ub85c \ucd9c\ub825","og_url":"https:\/\/www.auctionpro.co.kr\/?p=7114","og_site_name":"AuctionPro","article_published_time":"2022-03-18T06:19:11+00:00","article_modified_time":"2024-02-29T05:48:08+00:00","og_image":[{"width":923,"height":633,"url":"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png","type":"image\/png"}],"author":"golgol","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"golgol","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#article","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114"},"author":{"name":"golgol","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"headline":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825","datePublished":"2022-03-18T06:19:11+00:00","dateModified":"2024-02-29T05:48:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114"},"wordCount":8,"commentCount":0,"image":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#primaryimage"},"thumbnailUrl":"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png","articleSection":["[Dev]PHP"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.auctionpro.co.kr\/?p=7114#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.auctionpro.co.kr\/?p=7114","url":"https:\/\/www.auctionpro.co.kr\/?p=7114","name":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825 - AuctionPro","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#primaryimage"},"image":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#primaryimage"},"thumbnailUrl":"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png","datePublished":"2022-03-18T06:19:11+00:00","dateModified":"2024-02-29T05:48:08+00:00","author":{"@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"breadcrumb":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.auctionpro.co.kr\/?p=7114"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#primaryimage","url":"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png","contentUrl":"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2022\/03\/Soap_PHP.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.auctionpro.co.kr\/?p=7114#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/www.auctionpro.co.kr\/"},{"@type":"ListItem","position":2,"name":"php echo xml \ud615\uc2dd\uc73c\ub85c \ucd9c\ub825"}]},{"@type":"WebSite","@id":"https:\/\/www.auctionpro.co.kr\/#website","url":"https:\/\/www.auctionpro.co.kr\/","name":"AuctionPro","description":"\uc625\uc158\ud504\ub85c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.auctionpro.co.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2","name":"golgol","url":"https:\/\/www.auctionpro.co.kr\/?author=6"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7114"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7114\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}