NameSilo

MySQL Query Question

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

devanium

Established Member
Impact
0
If I have a database full of names, for example, and I want to query how many "John" names are in the database, how can I do this?

Any help would be greatly appreciated

Thanks!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
You can do something like this:
PHP:
$result = mysql_query("SELECT * FROM Table WHERE FirstName = 'John'") 
$num_rows = mysql_num_rows($result);
 
0
Close
select count(*) from table where name = 'John'
 
0
Close
or

SELECT * FROM Table WHERE Firstname LIKE '%John%'


then you'll get all names containing John.. like 'Johnny', 'Big John' ... etc...
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back