Jump to content

Selecting from a mysql table


LanceT

Recommended Posts

I'm using the following code

[code] $result = mysql_query("SELECT * FROM `table` WHERE type='$type' ORDER BY `name` ASC LIMIT

0,5", $dbh);[/code]

I have a row of types in my Mysql database, but is there a way I can make it so that type doesn't have to exactly equal the type in my database, but it only requires that the $type be present somewhere inside the string?

To be more clear, if $type was "hello", then it would select types of "hello" but also "hello, world"



Link to comment
https://forums.phpfreaks.com/topic/33988-selecting-from-a-mysql-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.