Skip to content

Tag: sql

Difficulty filtering by Select Column

I’m going to apologize in advance. I basically stumble through SQL as projects need done but my knowledge is rather lacking, so I apologize for any incorrect terminology or poor syntax. I would appreciate it if anyone would be able to help me out. I have the following query. I have also attached pics of the current Output and the

Using multiple queries (only one is working)

i would like to allow multiple users to login according to their userID and forward each user to his page. However only the last if condition works. Answer You only need to retrieve the User_type_id from the database and then decide on that which page to go to… Although a couple of major points – you should be using prepared

Create a View in SQL with a Concatenated Column > Then use Case Statement to affect values

I created a view with a concatenated column named DisplayName, using the code below. Is there a way to change specific DisplayName values using a case statement (or a better method) Something like: case when DisplayName = ‘Robert Jones’ THEN ‘Bob Jones’ when DisplayName = ‘Thomas Simms’ THEN ‘Tommy Simms’ or when FirstName = ‘Robert’ AND LastName = ‘Jones’ THEN

How to prevent SQL injection in Question2Answer?

I want to prevent SQL injection in Question2Answer. This is how I store data in MySQL via HTML form. I know it’s a security risk. Examples – OR and SQL query is – How should I post data in the latest PHP 7 and above version? I think escaping strings is deprecated or outdated. Answer Based on what little information