NameSilo

MySQL Query Question

Spacemail by SpaceshipSpacemail by Spaceship
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.
AfternicAfternic
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
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back