I use php4 and winxp.
This query works as expected:
$result = mysql_query("
SELECT feventid, UNIX_TIMESTAMP( fdate) as fdate, ftitle, fpostedby,
fdetails, factive, UNIX_TIMESTAMP( fpostdate) as fpostdate
FROM events
WHERE
fdate between '$datefrom' and '$dateto'
and factive
and fpostdate <= curdate()
ORDER BY fdate, fpostdate
");
However, when I add the condition
!(strpos(fdetai ls,'$fsearchstr ing')===false),
$result is false.
$result = mysql_query("
SELECT feventid, UNIX_TIMESTAMP( fdate) as fdate, ftitle, fpostedby,
fdetails, factive, UNIX_TIMESTAMP( fpostdate) as fpostdate
FROM events
WHERE
fdate between '$datefrom' and '$dateto'
and factive
and fpostdate <= curdate()
and !(strpos(fdetai ls,'$fsearchstr ing')===false)
ORDER BY fdate, fpostdate
");
Even simpler stuff like:
'and strpos('abc','c ')>0'
does not work.
I made two more discoveries trying to crack the problem.
'0=0', is an acceptable condition, while 'true' is not.
For the first query, $result does not return true, but 'Resource id #3'.
I have just started with php. What am I doing wrong?
Regards,
Jan Nordgreen
This query works as expected:
$result = mysql_query("
SELECT feventid, UNIX_TIMESTAMP( fdate) as fdate, ftitle, fpostedby,
fdetails, factive, UNIX_TIMESTAMP( fpostdate) as fpostdate
FROM events
WHERE
fdate between '$datefrom' and '$dateto'
and factive
and fpostdate <= curdate()
ORDER BY fdate, fpostdate
");
However, when I add the condition
!(strpos(fdetai ls,'$fsearchstr ing')===false),
$result is false.
$result = mysql_query("
SELECT feventid, UNIX_TIMESTAMP( fdate) as fdate, ftitle, fpostedby,
fdetails, factive, UNIX_TIMESTAMP( fpostdate) as fpostdate
FROM events
WHERE
fdate between '$datefrom' and '$dateto'
and factive
and fpostdate <= curdate()
and !(strpos(fdetai ls,'$fsearchstr ing')===false)
ORDER BY fdate, fpostdate
");
Even simpler stuff like:
'and strpos('abc','c ')>0'
does not work.
I made two more discoveries trying to crack the problem.
'0=0', is an acceptable condition, while 'true' is not.
For the first query, $result does not return true, but 'Resource id #3'.
I have just started with php. What am I doing wrong?
Regards,
Jan Nordgreen
Comment