Note that there are some explanatory texts on larger screens.

plurals
  1. POSelect Attributes from xml file with php
    primarykey
    data
    text
    <p>This my original XML, i want to run sql on it so i can just select one record from but, I've done it successfully, i want to get only record that i want</p> <pre><code>&lt;catalog&gt; &lt;product&gt; &lt;programname&gt;Teva Footwear&lt;/programname&gt; &lt;programurl&gt;http://www.teva.com?cid=aff_pr&lt;/programurl&gt; &lt;catalogname&gt;Teva Footwear Product Catalog&lt;/catalogname&gt; &lt;lastupdated&gt;03/25/2013&lt;/lastupdated&gt; &lt;name&gt;Teva Men Tanza Leather Sport Sandals in Brown&lt;/name&gt; &lt;keywords&gt;Teva Men Tanza Leather Sport Sandals in Brown&lt;/keywords&gt; &lt;description&gt;...&lt;/description&gt; &lt;sku&gt;1000183-BRN&lt;/sku&gt; &lt;manufacturer&gt;Teva&lt;/manufacturer&gt; &lt;manufacturerid&gt;1000183-BRN&lt;/manufacturerid&gt; &lt;currency&gt;USD&lt;/currency&gt; &lt;saleprice&gt;85.00&lt;/saleprice&gt; &lt;price&gt;85.00&lt;/price&gt; &lt;retailprice&gt;85.00&lt;/retailprice&gt; &lt;fromprice&gt;Yes&lt;/fromprice&gt; &lt;buyurl&gt;...&lt;/buyurl&gt; &lt;impressionurl&gt;http://www.awltovhc.com/image-6059025-10757671&lt;/impressionurl&gt; &lt;imageurl&gt;...&lt;/imageurl&gt; &lt;advertisercategory&gt;Men&lt;/advertisercategory&gt; &lt;promotionaltext&gt;Fast, Free Shipping and Free Returns!&lt;/promotionaltext&gt; &lt;online&gt;Yes&lt;/online&gt; &lt;instock&gt;YES&lt;/instock&gt; &lt;condition&gt;New&lt;/condition&gt; &lt;warranty&gt;...&lt;/warranty&gt; &lt;standardshippingcost&gt;0.0&lt;/standardshippingcost&gt; &lt;/product&gt; &lt;product&gt;...&lt;/product&gt; &lt;product&gt; &lt;programname&gt;Teva Footwear&lt;/programname&gt; &lt;programurl&gt;http://www.teva.com?cid=aff_pr&lt;/programurl&gt; &lt;catalogname&gt;Teva Footwear Product Catalog&lt;/catalogname&gt; &lt;lastupdated&gt;03/25/2013&lt;/lastupdated&gt; &lt;name&gt;Teva Men Original Mush Flip Flops in Tread Black&lt;/name&gt; &lt;keywords&gt;Teva Men Original Mush Flip Flops in Tread Black&lt;/keywords&gt; &lt;description&gt; See what all the hype is about and get yourself a pair of men's Teva Original Mush sandals today! Mush is the ultimate in flip flop foot-forming comfort. The Original Mush features a thicker sole and slightly wider forefoot and heel for a more generous fit. </code></pre> <p>This is I've done so far (of course i found code online)</p> <pre><code>&lt;?php // ---------------- The example uses the php 5 "DOM Functions" to select specific node uding Xpath query ------------------ $doc = new DOMDocument; // Create a new dom document $doc-&gt;preserveWhiteSpace = false; // Set features $doc-&gt;formatOutput = true; // Create indents on xml $doc-&gt;Load('Teva_Footwear-Teva_Footwear_Product_Catalog.xml'); // Load the file $xpath = new DOMXPath($doc); $query = '//catalog/product/sku[. = "1000183-WAL"]'; // The xpath (starts from root node) $names = $xpath-&gt;query($query); // A list of matched elements $Output=""; foreach ($names as $node) { $Output.=$doc-&gt;saveXML($node-&gt;parentNode)."\n"; // We get the parent of "&lt;firstname&gt;" element (the entire "&lt;person&gt;" node and its children) (maybe get the parent node directly using xpath) // and use the saveXML() to convert it to string } echo $Output."&lt;br&gt;\n\n"; // The result echo "&lt;hr&gt;&lt;br&gt;&lt;b&gt;Below view the results as HTML content. &amp;nbsp; (See also the page's HTML code):&lt;/b&gt;\n&lt;pre&gt;".htmlspecialchars($Output)."&lt;/pre&gt;"; ?&gt; </code></pre> <p>this is output after this code: (selected record by manufacturerid)</p> <pre><code>&lt;product&gt; &lt;programname&gt;Teva Footwear&lt;/programname&gt; &lt;programurl&gt;http://www.teva.com?cid=aff_pr&lt;/programurl&gt; &lt;catalogname&gt;Teva Footwear Product Catalog&lt;/catalogname&gt; &lt;lastupdated&gt;03/25/2013&lt;/lastupdated&gt; &lt;name&gt;Teva Men Tanza Leather Sport Sandals in Walnut&lt;/name&gt; &lt;keywords&gt;Teva Men Tanza Leather Sport Sandals in Walnut&lt;/keywords&gt; &lt;description&gt;Following in the footsteps of our other sports sandals (no pun intended) the Tanza Leather was built to perform. Featuring our Universal Strapping System with 3 points of adjustment as well as Shoc Pad&amp;amp;trade; technology the Tanza Leather gives you a luxurious feel without sacrificing functionality.&lt;/description&gt; &lt;sku&gt;1000183-WAL&lt;/sku&gt; &lt;manufacturer&gt;Teva&lt;/manufacturer&gt; &lt;manufacturerid&gt;1000183-WAL&lt;/manufacturerid&gt; &lt;currency&gt;USD&lt;/currency&gt; &lt;saleprice&gt;85.00&lt;/saleprice&gt; &lt;price&gt;85.00&lt;/price&gt; &lt;retailprice&gt;85.00&lt;/retailprice&gt; &lt;fromprice&gt;Yes&lt;/fromprice&gt; &lt;buyurl&gt;http://www.dpbolvw.net/click-6059025-10757671?url=http%3A%2F%2Fwww.teva.com%2Fwomens-tanza-leather-feminine-sports-sandals%2F737872627089%252Cdefault%252Cpd.html&lt;/buyurl&gt; &lt;impressionurl&gt;http://www.awltovhc.com/image-6059025-10757671&lt;/impressionurl&gt; &lt;imageurl&gt;http://www.teva.com/on/demandware.static/Sites-TEVA-US-Site/Sites-masterCatalogTeva/default/v1364225639089/images/large/T0183-WAL_1.jpg&lt;/imageurl&gt; &lt;advertisercategory&gt;Men&lt;/advertisercategory&gt; &lt;promotionaltext&gt;Fast, Free Shipping and Free Returns!&lt;/promotionaltext&gt; &lt;online&gt;Yes&lt;/online&gt; &lt;instock&gt;YES&lt;/instock&gt; &lt;condition&gt;New&lt;/condition&gt; &lt;warranty&gt;Teva has a 1 year warranty against defective materials and/or workmanship&lt;/warranty&gt; &lt;standardshippingcost&gt;0.0&lt;/standardshippingcost&gt; &lt;/product&gt; </code></pre> <p>How ever it's showing whole thing for that record what I want is something like this so i can format according to my needs. keywords in meta price description and photo linked by buy url something like <code>&lt;a href="$buyurl"&gt;&lt;img src="$image_url"&gt;&lt;/a&gt;</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload