I have a table which have a column with name domain_name
. in domain_name
column, different values stores like google.com
, facebook.com
, twitter.com
etc. I try this which is working.
$query= 'Select * from accountdb WHERE domain_name="twitter.com" order by domain_name ASC';
But I want to pick that rows which have the values facebook.com
, twitter.com
in one query. I try this to achieve but not working.
$query= 'Select * from accountdb WHERE domain_name="twitter.com" and domain_name="facebook.com" order by domain_name ASC';
Alterring quotes
$query= "Select * from accountdb WHERE domain_name='twitter.com' and name='facebook.com' order by domain_name ASC";
Any hint would be appreciated.
And means that both conditions have to be met which will never ever happen. You want domain_name to be either "twitter.com" or "facebook.com". So you have to use or
$query= 'Select * from accountdb WHERE domain_name="twitter.com" or domain_name="facebook.com" order by domain_name ASC';
If you have more than 2 domains to check, best way is to use in.
$query= 'Select * from accountdb WHERE domain_name in ("twitter.com","facebook.com","google.com") order by domain_name ASC';
You can use OR.
$query= 'Select * from accountdb WHERE domain_name="twitter.com" OR domain_name="facebook.com" order by domain_name ASC';
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
My php form inserts a few columns and an encrypted password into my tableHowever when I run it it says the variable number doesn't match the number of parameters
I am working on internal payslip portal using php, so my question is when user logged in this portal they have access to view any ones data, so i want to make restrictions to users when they login they only visible his personal data only,like google...
I have a little problem with function update in laravel
I've got a Laravel codebase which records are encrypted before they are inserted in the Mysql databaseIf I want to find a record based on one of the encrypted values, looping over all the records works: