Jump to content

Query using subset of string


fraser5002

Recommended Posts

Hi i have the following query for my database.

 

$query = "SELECT * FROM entries WHERE id = '$u'";

 

Is there anyway i can alter this to use all but the last 3 characters from "id"  for the query  ( will need to obviously determine the length of id for this entry in the database first )  i.e similar to the operation of the php statement substr()

 

 

Any Ideas?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/241092-query-using-subset-of-string/
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.