Continue high scores for help.
The requirements are as follows:
The existing call field in the table caller
State field Status
When the foreground is displayed, if status = Paid view
The caller phone number is displayed as 1331234**** (after 4 bits hidden)
Call logs have a search function.
Where caller supports fuzzy search
Now, if there are two numbers,
13356781234 and 1331234**** (* * * * = 5678, only the template is displayed as * * *, the database is 13312345678)
Ask me how to determine the status = Paid view when searching for a blur of 5678
Only the first one, not the second one.
------Solution--------------------
SQL Code
select * from table where table.column like '%5678% ' and status = ' paid view '
------ Solution--------------------
Search only the first 7 bits, where left (caller,7) like '%...% '
------solution--------------------
WHERE ( Status = ' pay View ' && left (caller,7) ' OR ' (Status! = ' pay to see ' caller like '%...% ')
What does that mean?
------Solution--------------------
appears only at the end of like '%5678 '
only appears at the beginning of the like ' 133% '
MySQL has regular expressions, you can use
Your requirements are not very clear.
------Solution--------------------
above () use and only for
------solution--------------------
can't be flexible.
SUBSTR (field, 1, LENGTH (field)-4) Like '%......% '
As for whether or not to pay, it is you control SQL statements in PHP code
------ Solution--------------------
Left function Oh, get the field length, minus the back 4 bits
You are all numbers here, length is OK
------ Solution--------------------
Amani11 That's OK
isn't that right?
WHERE (status = ' Paid View ' and SUBSTR (field, 1, LENGTH (field)-4) OR (Status! = ' paid view ' and caller Like '%...% ')