I was wondering if there was a contains word to use with a mysql query, my current query is :

//$query="SELECT * FROM $table WHERE date = '$selecteddate' AND Style = '$selectedstyle' AND Platform = '$selectedplatform'";

but the $selectedplatform isn't always the only thing in the Platform column, I just want to search the database to see if that column contains the value of $selectedplatform for the row in question.

Recommended Answers

All 4 Replies

Take a look at the LIKE search.
The following should select all records that have the word `John' in the `name' column.

SELECT * FROM client_names WHERE name LIKE '%John%';

select * from form where username='$username'&&password='$password';

$select=mysql_query("select * from form where username='$username'&&password='$password'");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.