Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot count values in column MySQL/PHP
    primarykey
    data
    text
    <p>I have the following table:</p> <pre><code>ID Name Phone Email SchoolGymnasium City Password Status 1 0 </code></pre> <p>I want to check if in the whole 'Directors' table in the column 'Status' exists value 0, if so to run the following HTML code:</p> <pre><code>&lt;h1 class="page-title projects"&gt;Директори&lt;/h1&gt; &lt;a href="javascript:;" id="add-project" class="btn add-project"&gt;Add Project&lt;/a&gt; &lt;div id="projects-alert" class="alert"&gt; &lt;a href="#" class="close" title="Close"&gt;X&lt;/a&gt;Quick tip: You can re-order projects by dragging and dropping them into place.&lt;/div&gt; </code></pre> <p>else to run the following code:</p> <pre><code>&lt;div id="no-projects"&gt; &lt;h2&gt;В момента няма подадени заявки.&lt;/h2&gt; &lt;p&gt;Ако желаете може да добавите директор, като кликнете не бутон по-долу. Информация за вход в системата ще бъде изпратен на посоченият е-мейл.&lt;/p&gt; &lt;a href="javascript:;" class="btn add-project"&gt;Добавете Директор&lt;/a&gt; &lt;/div&gt; </code></pre> <p>To do this I've done the following, and it didn't happen:</p> <pre><code>&lt;?php $jojo = mysql_query("SELECT COUNT(id) AS Status FROM Directors WHERE Status = '0'"); if(mysql_num_rows($jojo) &gt; 0){?&gt; &lt;h1 class="page-title projects"&gt;Директори&lt;/h1&gt; &lt;a href="http://denismm778.dunked.com/admin/projects/new" id="add-project" class="btn add-project"&gt;Add Project&lt;/a&gt; &lt;div id="projects-alert" class="alert"&gt; &lt;a href="#" class="close" title="Close"&gt;X&lt;/a&gt;Quick tip: You can re-order projects by dragging and dropping them into place.&lt;/div&gt; &lt;?php } else{ ?&gt; &lt;div id="no-projects"&gt; &lt;h2&gt;В момента няма подадени заявки.&lt;/h2&gt; &lt;p&gt;Ако желаете може да добавите директор, като кликнете не бутон по-долу. Информация за вход в системата ще бъде изпратен на посоченият е-мейл.&lt;/p&gt; &lt;a href="javascript:;" class="btn add-project"&gt;Добавете Директор&lt;/a&gt; &lt;/div&gt;&lt;?php }?&gt; </code></pre> <p>The idea is this. If there is Status 0 anywhere in the column Status to show the first HTML code, else to show the second code.</p>
    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.
 

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