Jump to content

PHP Like Help


AJLX
Go to solution Solved by ginerjm,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.