Mysql queries

I would like to know if you can do something like this

Search term : television
SQL code : select * from repairs where technology = tele

Basically I would like to have the option to search the database by abbreviation of say the word ‘television’ abbreviated to tele and for mysql to pull all rows containing columns with the abbv tele

Hopefully that makes sense and you can help

In my mind I have
Select * from repairs where technology contains= tele

That’s probably not right

How many possible values are there for “technology”, if there aren’t too many consider using a drop-down menu in your form.

You are close:

Select * from repairs where technology like ‘%tele%’;

That will match any rows where technology contains the snippet tele

Select * from repairs where technology like ‘tele%’;

That will match any rows where technology starts with the snippet tele

That’s great cheers for your help

I have got a similar new problem, I have got the code :
Select * from vall where collected=0 like ‘" . $_POST[‘namesearch’] . "’%’ order by repair_id desc

I’m not sure why this is not working as it seems to work in php my admin I’m assuming my post variable is causing problems

‘" . $_POST[‘namesearch’] . "'%’

I spy with my little eye an extra quotation mark.

Sharp eyes :smiley:

That is way when debugging, it is a good idea to echo out the query, so you can see if it effectively is what you think it to be.