Jump to content

Recommended Posts

I'm trying to figure out why its displaying the file_open icon OUTSIDE of the table.

 

<?php 
while ($row = mysqli_fetch_array($menuStructuresResult, MYSQLI_ASSOC)) {
    $menuStructures .= "<tr>";
    $menuStructures .= "<td><input type=\"checkbox\" name=\"menuStructures\" value=\"".$row['id']."\"/></td>";
    $menuStructures .= "<td>".$row['id']."</td>";
    $menuStructures .= "<td>".$row['menuName']."</td>";
    $menuStructures .= "<td>".$row['shortName']."</td>";
    $menuStructures .= "<td>";
    if ($row['multiLevel'] == 'Yes'){
        echo "<a href=\"#\"><img src=\"".$managerURL."images/file_open.png\" class=\"menuCateggories\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>";
    }
    $menuStructures .= "</td>";
    $menuStructures .= "<td>";
    if ($row['multiLevel'] == 'No'){
        echo "<a href=\"#\"><img src=\"".$managerURL."images/link.png\" class=\"menuLinks\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>";
    }
    $menuStructures .= "</td>";
    $menuStructures .= "<td><a href=\"#\"><img src=\"".$managerURL."images/user_edit.png\" class=\"edit\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a></td>";
    $menuStructures .= "<td>";
    $menuStructures .= "<a href=\"#\" class=\"ask\"><img src=\"".$managerURL."images/trash.png\" class=\"delete\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>";    
    $menuStructures .= "</td>";
    $menuStructures .= "</tr>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/
Share on other sites

this is most likely because the $menuStructures variable is getting output later than the echo...try this

 

$menuStructures .= "<td>";
    if ($row['multiLevel'] == 'Yes'){
        $menuStructures .= "<a href=\"#\"><img src=\"".$managerURL."images/file_open.png\" class=\"menuCateggories\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>";
    }
    $menuStructures .= "</td>";

 

same goes for the other one, instead of outputting the links...you need to concatenate them onto your variable for output..

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.