Friday, March 29, 2013

Of MySQL’s query returns the highest number from PHP?


Consider made by josh: How would you return the highest number of a mysql query in PHP?

Say i had a query that was “select email from users”. I’ve selected the whole column of “email”. How would i return the highest number in that whole field? Is that even possible?


Truly needed to know about How would you return the highest number of a mysql query in PHP? which you might want to solve troubles without any help. I hope this can help in many ways; to create your own life better. Dreaming needed to know about How would you return the highest number of a mysql query in PHP? could possibly be a strategy at a later date.

Best answer:


Answer by twee_grrrl

use the sql MAX command.


http://www.plus2net.com/sql_tutorial/sql_max.php


Answer by raina_vissora

The highest number? I’m not sure I understand what you’re after. Wouldn’t the email field be a text data type, as opposed to a numerical data type?


If for some reason you’ve named a numerical field “email”, you could just for SELECT * FROM `users` ORDER BY `email` DESC LIMIT 1; or just SELECT MAX(`email`) FROM `users`;. That would give you the highest value in a numerical column.


Know far better?

Leave your own individually styled answer within a comments!


Email training that works.


email


Representation through email


email



Of MySQL’s query returns the highest number from PHP?

No comments:

Post a Comment

Blog Archive