I have a mysql table with an x amount of columns. I would like to check if the rows of a specific columns are empty or not ..
Currently I have:
$query10 ("SELECT count(*) FROM content WHERE linkname IS NOT NULL") or die(mysql_error());
$result10 = mysql_query($query10);
$row10 = mysql_fetch_assoc($query10);
echo $row10['0'];
But I get an error:
Fatal error: Function name must be a string in ... on line 227
I never used count, before I used num_rows .. but can't seem to get it to work with that either ..
So just to make clear, my table looks like
| column1 | column2 | column3 |
--------------------------------------------
| a | b | |
---------------------------------------------
| a2 | b2 | c2 |
----------------------------------------------
| a3 | b3 | |
I want to count al rows of column3 that are not empty, so in this case the result of count should be 1.
counting gives following error:
mysql_fetch_assoc() expects parameter 1 to be resource, string given
Thanks so much
$query10 ("SELECT count(*) FROM content WHERE linkname IS NOT NULL")you are storing query in variable i guess, so do like this$query10 = "SELECT count(*) FROM content WHERE linkname IS NOT NULL";removed parenthesisfetch_assocfunction is here.