Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

MySQL Query Question

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
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

Parking: your own icon for your portfolio
You can now upload a small icon (a favicon) for your portfolio. Browsers show it in the tab and in bookmarks. It shows on your NamePros...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back