Skip to content
Advertisement

Tag: php

Condition inside a SQL Query

I want to create a query, that will show the word “Passed” if the DATEDIFF(so_date,actual_delivery) = 3 then show “Failed” if not. Can someone help me please?

How to pass a php variable in WHERE clause of SELECT statement?

I have a php variable that I want to fetch another field in database using this variable in my where clause. My code: But this is printing me nothing. Don’t know where I am going wrong but any help would be appreciated. Answer You can either break the string and concatenate the variable with “..” Or you could wrap the

WordPress delete posts not in specific categories using wpdb query

How do I modify the following query to delete all posts with the custom post type “listings” that are NOT IN specific Wordpress categories? Note, I must use $wpdb->query() in my particular situation. My categories for exclusion are term ID’s 21, 22, and 24. UPDATE – THIS query brings me a lot closer to what I am after but throws

SQL error when inserting a function variable

I try to use a value resulted from a 1st function as argument into a 2nd function, but SQL give me the error cannot be NULL Erreur de la base de données WordPress : [Column ‘option_price’ cannot be …

Advertisement