Skip to content

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 “..&#…

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 …