-3

I can fetch the desired record using MySQLi query directly in the database. But how to reflect the count in the webpage as it shows data in the result-set of phpMyAdmin interface?

Below is the MySQLi query I have used to fetch the below detail.

SELECT `recordUniqueID`, COUNT(*) FROM `status_data` WHERE
`status_data`.`statusName` = '1'
AND `status_data`.`emailAddress` = 'shashibhushan.roy@abcd.com'
AND `status_data`.`recordCreatedDateTime` BETWEEN '2018/11/25 10:00' AND '2019/03/02 10:00'
GROUP BY `recordUniqueID`
HAVING COUNT(*) >= 1
ORDER by id ASC 

Below is the result I got in phpMyAdmin interface

enter image description here

Below is the screen from my webpage where I want to show the count of respective rows.

enter image description here

The yellow space I want to fill with the count of the respective rows (repeat values).

https://i.stack.imgur.com/9UeDn.png

https://i.stack.imgur.com/Dmy2w.png

Dharman
  • 30,962
  • 25
  • 85
  • 135
Shashi Roy
  • 11
  • 3
  • Is there any specific reason for downgrading this question? I can make it more clear if I could not explain it better. – Shashi Roy Feb 23 '19 at 14:24
  • 1
    Text is ALWAYS preferable to pictures of text – RiggsFolly Feb 23 '19 at 14:30
  • 1
    And showing us the code you use to process the query result would have been a hugh advantage as we could then see what you are doing. **Please remember we are not clairvoyant** – RiggsFolly Feb 23 '19 at 14:31
  • 1
    You should at least post the code where you "show" the other data. And many people don't like to klick links in order to undertand your question. – Paul Spiegel Feb 23 '19 at 14:31
  • 1
    add the code where you use the query and echo the result .. .. please – ScaisEdge Feb 23 '19 at 14:32
  • I am new to stackoverflow and as of now its not allowing me to add image as a part of the question. My question is very simple that the result I see in phpmyadmin, I want to get it reflected in using PHP in my website. I am able to show the column but Count is not an actual column in my table. Could someone please help me with this? Kindly click on the link of the image to understand my question better. Thanks in advance. – Shashi Roy Feb 23 '19 at 14:36

1 Answers1

0

You could add an alias to you count column (eg: my_count)

    SELECT `recordUniqueID`, COUNT(*)  my_count
            FROM `status_data` 
            WHERE `status_data`.`statusName` = '1' 
            AND `status_data`.`emailAddress` = 'shashibhushan.roy@abcd.com' 
            AND `status_data`.`recordCreatedDateTime` BETWEEN '2018/11/25 10:00' AND '2019/03/02 10:00' 
            GROUP BY `recordUniqueID` 
            HAVING COUNT(*) >= 1 ORDER by id ASC

and then you could echo the value accessing using the alias assumin the resulting rows are returned in a $row var :

echo  $row['my_count'];
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107