mySQL query from a table [closed] - php

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 days ago.
Improve this question
A company maintains the data of its customers in the CUSTOMER table. write a query to print the ids and the NAMEs of he customers who are from the USA and whose credit limit is greater than 100000, ordered by increasing ID number
TRIED TO query it from one table but checking the validation is hard for me

Related

I would like to exclude some rows by Eloquent [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 months ago.
Improve this question
I have a user table that contains a colum "role"
i would like to exclude the ones that contains a certain role by Eloquent
Does any one knows a solution for this ?
To answer your original comment
User::query()->whereNotIn('role', 'blabla')->get();
To answer the second edit of the comment:
User::query()->whereNotIn('role', [
'Admin', 'responsable', 'magasinier', 'demandeur'
])->get();
To answer the third edit of the comment:
User::query()->whereNotIn('role', 'demandeur')->get();

How to put more than one specicfication after the WHERE part when selecting data in php pdo [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am creating a website that takes data from the user and searches in some database for a hall that meets all the users specifications so I search in the database using php pdo method by typing
(SELECT * FROM thetablename WHERE place=$place,category=$category)
But it doesn't work, I want the choose raw to have a hall name that I will get later and this hall contains all the specifications of the user together.
(SELECT * FROM thetablename WHERE place=$place AND category=$category)
You need to use the AND keyword.
You could of answered this with some simple searching.
SQL Where

Update of the foreign key to a null value [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
This query generates an error:
UPDATE sale
SET NumFacture='Null',
WHERE Code='22'
Where NumFacture is a foreign key in table sale so I can't update it with Null value. How can I do please!
Try without single quotes:
UPDATE sale
SET NumFacture=Null
WHERE Code='22'

How to Set Budget (Maximum call price) in Twilio Account [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
How would one set a maximum call price? For example, limit the spend to $0.25 per call using Twilio.
If the calls cost exceeds this limit, then disconnect call.

MySQL unrepeatable rows search query [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I save some images in my database. Each images have a "tags" property.
I'm gonna show "search by tags" result to users, but there is a problem.For example, "IMAGE1" has "c#, programming, scripting" tags and I'm gonna show every images which have "programming" and "scripting" tags. So If I do that, "IMAGE1" will be duplicated.
So how can I prevent this duplicating ?!
Thanks !!
You can use DISTINCT operator of MySQL to retrieve non-duplicates
SELECT DISTINCT `imagename`
FROM `images`
WHERE (`tags` = 'programming') OR (`tags` = 'scripting')
The conditions for WHERE may be different depending on your PHP code.

Categories