How to write $table contains, instead of equals?

A

Anonymous

Guest
I want mySQL to return rows in table "comp", where c_addr contains (but may not equal) $kword.

I know how to write...

$query = "SELECT * FROM comp WHERE c_addr = '$kword'";

but I don't know how to ask for rows that just contain, but may not equal my $kword. Is this even possible? Please help. Thank you for you time and attention.
 
the answer is,

$query = "SELECT * FROM comp WHERE c_addr LIKE '%$kword%'";
 
Back
Top