Jump to content

[SOLVED] how to search a table


hasanatkazmi

Recommended Posts

$sql = "SELECT * FROM `$table` WHERE `$column` = '$var'";

 

this will work as long as there is nothing but that value in the column. If there is more text you will get back nothing. You would have to use LIKE and wildcards to get more results

 

$sql = "SELECT * FROM `$table` WHERE `$column` LIKE '%".$var."%'";

 

Ray

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.