I have a news box that I only want to show if the number of rows is not existing or there is one row inserted. If there is two rows, I'm showing something else.
<?php
$getUsers = mysql_query("SELECT *
FROM users
WHERE id = '".$_SESSION['user']['id']
."' Order by id ASC");
while($usersinfo = mysql_fetch_array($getUsers))
{
$getProject = mysql_query("SELECT *
FROM `cms_prosjekt`
WHERE code = '".$usersinfo['motto']
."' Order by id DESC");
while($projectinfo = mysql_fetch_array($getProject))
{
$result = mysql_query("SELECT *
FROM cms_news_front
WHERE userid = '".$projectinfo['userid']
."' AND code = '".$usersinfo['motto']
."' OR userid = '".$projectinfo['userid']
."' AND code = 'alle'
Order by title ASC
LIMIT 0, 1");
if(mysql_num_rows($result) == 1 || 0)
{
echo'<ul class="grid cs-style-3">
<li style="margin-top:-15px;">
<div id="box">Ingen nyhet opprettet2.</div>
<img src="http://media.istockphoto.com/photos/blue-background-picture-id518094392?k=6&m=518094392&s=170667a&w=0&h=jFq7AAr7Uu2yyTBEtyjAbV477WgWwXCrWgDD5zLz4UU=" alt="img01" style="max-width:100%; height:270px; width:100%; border-radius:5px;"></a>
</figure>
</li>
</ul>';
}
}
}
?>
The main problem is that when I have two rows inserted, it still shows the ouput from the above query. I only want to show it when I have no inserts and one inserted row.
Any suggestions?