How to write $table contains, instead of equals?

Codes here !

Moderators: macek, egami, gesf

Tony121076
New php-forum User
New php-forum User
Posts: 28
Joined: Fri Jan 03, 2003 4:00 pm

How to write $table contains, instead of equals?

Postby Tony121076 » Mon Feb 03, 2003 7:38 am

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.

Tony121076
New php-forum User
New php-forum User
Posts: 28
Joined: Fri Jan 03, 2003 4:00 pm

I found the answer...

Postby Tony121076 » Mon Feb 03, 2003 9:02 am

the answer is,

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


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest