I know that this is probably a really simple problem to fix but I can’t really find any info on it.
I’ve got a function called ‘Duration()’ which calculates how many hours have passed on a date.
However I would like to use the function within a SQL query.
$result = mysql_query("SELECT * FROM eagle6_edb.edb_scans WHERE solarSystemID = '$solarSystemID' AND Duration(date) < 48 ORDER BY id DESC");
$probing_num = mysql_num_rows($result);
Doesn’t seem to be working?
I know the function works fine as I’m using it else where…
You can’t use a PHP function in a query unless your returning a value and embedding it into the query. You would either need to calculate it before hand and embed or use a MySQL equivalent function or series of functions.