Unstoppable Domains โ€” AI Assistant

MySQL Query Question

SpaceshipSpaceship
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
•••
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
•••
select count(*) from table where name = 'John'
 
0
•••
or

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


then you'll get all names containing John.. like 'Johnny', 'Big John' ... etc...
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back