Note that there are some explanatory texts on larger screens.

plurals
  1. POphp mysql error: Warning: mysqli_error() expects exactly 1 parameter, 0 given
    primarykey
    data
    text
    <p>I want to display the items from the database once using the description attribute of the files. For example i uploaded 3 files, automatically they have the same information except for the primary key. </p> <pre><code>if($type=="Title"){ $key = $_POST['search_key']; if($key!=null){ $result = mysqli_query($con,"SELECT DISTINCT description FROM __scannedfiles WHERE title='$key' AND deptname='$dept_name'") OR die(mysqli_error()); $count =mysqli_num_rows($result); if($count==0){ echo '&lt;script type="text/javascript"&gt; window.onload = function(){alert("File not found!")} &lt;/script&gt;'; } else if($count&gt;0) { echo'&lt;div class="searched_items_pane"&gt; &lt;table class="table" width="100%" style="table-layout:fixed"&gt; &lt;col width="20%"&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;th&gt; Title &lt;/th&gt; &lt;th&gt; Type &lt;/th&gt; &lt;th&gt; Date &lt;/th&gt; &lt;th&gt; Description &lt;/th&gt; &lt;/tr&gt;'; while($row = mysqli_fetch_array($result)){ echo'&lt;tr&gt; &lt;td&gt;&lt;a href="items.php? desc='.urlencode($row[7]).'"onClick="MM_openBrWindow(\'items.php?desc='.urlencode($row[7]).'\',\'google\',\'width=650,height=500\'); return false;"&gt; &lt;img src="Folder-Blank-icon.png"&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt; '.$row[1].' &lt;/td&gt; &lt;td&gt; '.$row[5].' &lt;/td&gt; &lt;td&gt; '.$row[6].' &lt;/td&gt; &lt;td&gt; '.$row[7].' &lt;/td&gt; &lt;/tr&gt;'; } if($count&gt;0){ echo'&lt;/table&gt; &lt;/div&gt;'; } } } } mysqli_close($con); } </code></pre> <p>result:</p> <pre><code> karla Memo 2012-12-31 2131 karla Policy 2013-12-31 121212 karla Memo 2013-12-31 qweqw karla Memo 2013-12-31 qweqw </code></pre> <p>here is the desired result:</p> <pre><code> karla Memo 2012-12-31 2131 karla Policy 2013-12-31 121212 karla Memo 2013-12-31 qweqw </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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