php - SQLite select query with like condition in reverse -


I am trying to write a query in php which will select a row from a database that is partly by a string Matches.

Better explained through an example:

My DB has a code which is named numberString in which the value is 'abcd'. I want to write a question that "123abcd" is returned, will return an area of ​​that line of the database.

  Selection mood from users where 'string string' is like 'string string' '  

$ denmark string function parameter (I.e. the string that I want to see)

But I think those two number string and '$$ given number string' " query To work as expected, there should be another way to do it. Is there any way to do this?


OK, the table is Type looks:

  id | username | number string | mood --------------------------- ---------- 1 | My Usaran | ABCD | happy   

Now I want to give "123abcd" to recover the person's mood. In order to match 123BCcd against ABCD.

I'm not sure this is a legal syntax, but Try me a wild guess: do you choose from users Have tried

  Choose from mood users where 'denmark string' like '%' || Number string || '%'   

?

Comments