Jump to content

PHP Like Help


AJLX

Recommended Posts

Hello Guys,

 

I have a system that generate project numbers. The system is:

YEAR - PROJECT NUMBER . Sub ID

 

2014.1065.02

 

I want to be able to search my database for the sub ID's belonging to a project. I have tried using wildcards, but they don't seem to do what I want. Could you please tell me where I'm going wrong?

$project_id = $_SESSION['PROJECT'];
$project_id_trim = substr($project_id, 0,-3);
$trim = mysql_real_escape_string($project_id_trim);
echo $trim;

$result = mysql_query("SELECT * FROM `Project_subhire` WHERE `Subhire_id` LIKE '%$trim%'");




while ($row = mysql_fetch_array($result)) 
{
$project_results = $row['Project_id'];
}

Thanks

Link to comment
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.