Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with position of data while displaying
    primarykey
    data
    text
    <p>I have 2 tables named authors &amp; books. Authors must have a logo. I have to display this like author name , logo,then all the books of that author and so on. books table contain a field (show_logo), if the show_logo is 0 for all the books of that author then the logo will display at the begining (ie after author name) else logo will display after that book(show_logo 1). If the show_logo is 1 for any book then it will display properly after that book, Otherwise won't..am using the code below</p> <pre><code>&lt;?php if ($author) { foreach ($$author as $key =&gt; $val) { ?&gt; &lt;tr style="background-color: #58353C;"&gt;&lt;?php if ($val['$author_image']) { ?&gt; &lt;td&gt;&lt;img src="&lt;?= base_url(); ?&gt;uploads/&lt;?= $author; ?&gt;" style="width: 90px;height: 90px;"/&gt;&lt;/td&gt; &lt;td style="color: #F5E78F;" colspan="4"&gt;&lt;b&gt;&lt;?= $val['$author_name']; ?&gt;&lt;/td&gt; &lt;? foreach ($val['books'] as $key =&gt; $val1) { ?&gt; &lt;tr style="background-color:&lt;?= $color ?&gt;"&gt; &lt;?php if ($val1['author_image']) { ?&gt; &lt;td style="padding-left: 20px;color: black; "&gt;&lt;img src="&lt;?= base_url(); ?&gt;uploads/&lt;?= $val1['author_image']; ?&gt;" style="width: 75px;height: 75px;" /&gt;&lt;/td&gt; &lt;?php } ?&gt; &lt;td style="color: black;"&gt;&lt;?= $val1['author_title']; ?&gt;&lt;/td&gt; &lt;td width="150px" style="text-align: left;color: black;"&gt;&lt;a class="more" style="color: black;font-size: 11px;" href="&lt;?= site_url('author/author_view/' . $key); ?&gt;" rel="facebox"&gt;More Details..&lt;/a&gt;&lt;/td&gt; &lt;? if ($val1['show_logo'] == '1') { if ($val['author_logo']) { ?&gt;&lt;/tr&gt; &lt;tr style="background-color:&lt;?= $color; ?&gt;" on&gt; &lt;td colspan="5"&gt;&lt;img src="&lt;?= base_url(); ?&gt;uploads/&lt;?= $val['author_logo']; ?&gt;" style="width: 998px;height: 175px;" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;? } } else { ?&gt;&lt;/tr&gt; &lt;? } $counter++; } } } } ?&gt; </code></pre>
    singulars
    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