title: Making dynamic Link using mysql query but making php can Read it
body: <p>I want to ask a problem that might be quite simple. But I'm confused about where to find a solution. </p>
  
  <p>I tried dynamically creating menu, by fetching the data with a mysql query, I managed to get the data together with the html format I wanted</p>
  
  <pre><code>    SELECT CONCAT("&lt;ul&gt;", dede, web, "&lt;/ul&gt;") as persetujuan FROM
  (SELECT  
   concat("&lt;li&gt;&lt;a href='#'&gt;",permissionweb1.`Description`,"&lt;/a&gt;&lt;ul&gt;") as dede , GROUP_CONCAT("&lt;li&gt;&lt;a href='../",grup.FolderName,"'&gt;", grup.Description, "&lt;/a&gt;&lt;/li&gt;" SEPARATOR ' ') as web
  FROM
    `permissionweb`
    INNER JOIN `employeewebpermission` ON (`permissionweb`.`ID` = `employeewebpermission`.`WebPermission`)
    INNER JOIN `employee` ON (`employeewebpermission`.`Employee` = `employee`.`ID`)
    INNER JOIN `permissionweb` `permissionweb1` ON (`permissionweb`.`ParentID` = `permissionweb1`.`ID`)
    LEFT JOIN (
        SELECT `employeewebpermission`.`WebPermission`, `permissionweb`.`Description`, `permissionweb`.`FolderName`
        FROM `employeewebpermission`
        INNER JOIN `permissionweb`   ON (`permissionweb`.`ID` = `employeewebpermission`.`WebPermission`)
  
  ) grup ON (grup.WebPermission = `permissionweb`.ID)
  WHERE
    `employee`.`ID` = 1468
  GROUP BY `permissionweb`.`ParentID`) PERMISSION
  </code></pre>
  
  <p>The result is like this per-row</p>
  
  <pre><code> &lt;ul&gt;&lt;li&gt;&lt;a href='#'&gt;IT&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href='../cpu'&gt;Daftar CPU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../itstok'&gt;Stok IT&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../itstok'&gt;Stok IT&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../hardware'&gt;Daftar Hardware&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../cpu'&gt;Daftar CPU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../cpu'&gt;Daftar CPU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../itstok'&gt;Stok IT&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../hardware'&gt;Daftar Hardware&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../cpu'&gt;Daftar CPU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../itstok'&gt;Stok IT&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../hardware'&gt;Daftar Hardware&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='../hardware'&gt;Daftar Hardware&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>and my job now is just to echo the php. But the problem is because the html format... i can't excecute the sql from php, like this image.. </p>
  
  <p><a href="https://i.stack.imgur.com/bsiTu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bsiTu.png" alt="enter image description here"></a></p>
  
  <p>Iknow the problem is the concat of ul and li, what format should i do? yes i MUST using that query and doing echo and not making html.</p>
  
  <p>Thank you..</p>