-
MySQL query [Resolved]
I am having problems with a query. It looked like this (here it works):
Code:
$resultat = mysql_query("select fArrID, fBy, fDato, fSted, fNavn, fText, fBildebox from fremover where fBy like 'B' and fDato >= ".$StartDato." ORDER BY fDato",$db);
But I also want it to catch those where "fBy like 'A'
I tried this:
Code:
$resultat = mysql_query("select fArrID, fBy, fDato, fSted, fNavn, fText, fBildebox from fremover where fBy like 'A' or where fBy like 'B' and fDato >= ".$StartDato." ORDER BY fDato",$db);
and this
Code:
$resultat = mysql_query("select fArrID, fBy, fDato, fSted, fNavn, fText, fBildebox from fremover where fBy like 'A' or fBy like 'B' and fDato >= ".$StartDato." ORDER BY fDato",$db);
But no luck...any idea?
-
Not sure about mySQL, but in MSSQL or evben Access, when you use the LIKE clause, don't you need to include some kind of wildcard character??
LIKE '*A*' or LIKE 'B*'
???
TG
-
I just tested without WHERE once more, and then suddenly the warning dissapeared...but it is still just picking the once with B and not the once with A..:(
Tried your solution, but it didn't help techgnome. It worked with just 'B' in it, but I still can't get the 'A's to work with it..:(
-
hhm.. I know this is a terrible work around, but you could do two queries, then combine the arrays.
-
Yeah I could...but the ultimate solution in the end was trying one thing then go back...and suddenly it worked with the last solution I posted in my first post...I have NOOO idea why...maybe it did flush the cache corectly or something....bad bad bad...at least now it works...so I am not touching it again....thanks to all of you..