php - Count amount of items with the same value in the table -


I have a table like this:

  PostId PostTotal PostDesk PostContent Post Post 2 Headlineupdate and lieutenant; P & gt; DescUpdate & lt; / P & gt; & Lt; P & gt; ContUpdate & lt; / P & gt; 2014-10-27 16:31:24 admin  

I want to get the quantity of items with the PostUuser as an administrator, which is in this case 1. Is anyone with me in this Can help? Edit: Sorry, I mean $ _SESSION ['login'] instead of admin so search for where postUser $ _SESSION ['login']

EDIT2: when I I use this: selecttable (*) yourtable WHERE postUser = 'admin' I get this error: parse error: Syntax error, on Line 93: D: \ xampp \ htdocs \ AAWebsite \ blog \ index.php Unexpected ' Administrator '(T_TTIITI)

My Row 93: $ getamount = $ db-> Query (' Selection Number (*) from Blog_posts WHERE postUser = 'admin' ');

You can use the following question: -

  SELECT Yourtable from count (*) WHERE postUser = 'admin'  

Here is the name of yourtable database table.


Comments