php


Show rows with a column partially matching a given parameter


Suppose I have a table named testdb which has the following values:
| Name | Phone |ID |
|------------------|------------|---|
| supriyo roy | 9038689236 | 2 |
| supriyo banerjee | 8013147879 | 3 |
| Alex ghosh | 8985855665 | 4 |
Now, I am performing a search by the name and the input given is just "supriyo" (no last name given).
The search result should show both the values:
| Name | Phone |ID |
|------------------|------------|---|
| supriyo roy | 9038689236 | 2 |
| supriyo banerjee | 8013147879 | 3 |
Is this possible to achieve using MySQL and php?
You are looking for LIKE:
select *
from your_table
where name like 'supriyo%';

Related Links

Is value In_array?
using date picker it doesnot display data of a date(date from datepicker) from database
checking if table contains value won't work (SELECT COUNT) [duplicate]
Date picker event for tooltip data
How can i protect profile form update by other users laravel 5.3
Doctrine query: find entity that contains array in many-to-many association
How to properly call models in codeigniter?
How to delay for 5 sec and then use file_get_contents PHP?
How to display a Twiml XML Object
regex for validating ip-range from ip-list
Understanding WHMCS hook priorities
Getting Array Key Value in array
TesseractOCR not working for Laravel
Json_decode not functioning expecting array to be a string [closed]
How to save checkbox value to database Laravel
Database error on aimeos install (Laravel 5.3)

Categories

HOME
spring-data
azure-functions
yii
paypal-ipn
applescript
enums
mongoid
malware
web2py
material-components
capistrano
google-search-console
selection
swarm
cqrs
vimeo
createjs
ex
fresco
heap-dump
pinterest
user-defined-types
jaspersoft-studio
spam
coreldraw
liferay-6.2
gollum-wiki
eclipse-emf
mod-wsgi
jpa-2.1
router
background-color
jackrabbit-oak
annotation-processing
materialize
autodesk-model-derivative
progid
fotorama
caesar-cipher
knights-tour
listjs
keyboard-layout
jslint
xll
recovery
suds
jacoco-maven-plugin
pyttsx
code-push
wysihtml5
password-hash
deedle
glassfish-4.1
sesame
word-2016
perl-data-structures
jsf-2.3
nunit-console
tsqlt
msbuild-4.0
simian
adjacency-list
currency-exchange-rates
vim-plugin
boost-proto
bayesglm
dsa
asp.net-web-api-helppages
netdatacontractserializer
supercomputers
replicaset
org-babel
kefir.js
unidata
azure-xplat-cli
innerhtml
mojo
directorysearcher
jcheckbox
visual-studio-6
jini
zend-search-lucene
air-native-extension
tabletools
accountmanager
cloo
vlab
jacob
ui-design
chefspec
android-authenticator
ckeditor.net
email-verification
cgrectmake
gitx
playorm
arrow
system-information
monocross
exponent
groovy-console
css-friendly
qcar-sdk
django-pagination
channelfactory
aptitude
tabbarcontroller
sqlsitemapprovider
objectinstantiation

Resources

Encrypt Message