Example of MySQL columns data:
stringone
stringthree
stringtwo
stringone
stringone
stringthree
How can I get the following result from MySQL with PHP or mysql_ itself? I don't know strings content.
stringone 3x
stringthree 2x
stringtwo 1x
Thank you for your suggestions and direction.
try this:
SELECT columnname1,count(columnname1)
FROM tablename
GROUP BY conlumnname1;
SELECT string, COUNT(1) FROM table GROUP BY string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With