runnerjp
asked on
else statment only ever outputs the first statement
im trying to grab from the db users that have posted in my forum... so then if they have posted in a spesific thread then it will show an icon ...
think is my code only shows yes u possted here... no matter what the outcome :S
think is my code only shows yes u possted here... no matter what the outcome :S
<?php
require_once '../settings.php';
$query = mysql_query("SELECT COUNT(postid) FROM forumtutorial_posts WHERE postid='255' OR parentid = '255' AND author='demo'");
if($query != 0) {
echo 'yes you poster here';
}
else
{echo 'no';}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>also whats this ($query, 0,0);
actually, that is mysql_result($query, 0,0);
that function returns the first column (0-based index) from the first row (again, 0-based index) from the query handle ($query). more info:
www.php.net/mysql_result
actually, that is mysql_result($query, 0,0);
that function returns the first column (0-based index) from the first row (again, 0-based index) from the query handle ($query). more info:
www.php.net/mysql_result
ASKER