Afficher un message
Vieux 14/06/2008, 02h50   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Can't use LIKE in IF() ...

Mo wrote:
> so what do I use?
> In my report, I want to assign a value to a var if the item came from
> a specific area in our inventory.
> If the location begins with "WIP", then assign a value of "true".
>
> The $row is from a MySQL_fetch_assoc() in a WHILE statement.
> I tried:
> if($dtlRow["loc"] LIKE "WIP%" )
> {
> $brokered=true;
> }
> but got a syntax error.
> Apparently, I'm barking up the wrong tree, and LIKE is not the right
> way to do this.
>
> I've got my PHP manual ready, but just can't find what I need to look
> up.
>
> TIA,
> ~Mo
>


LIKE is a SQL construct, not a PHP one. You need to use PHP operators
or functions, like ==, strcmp, or a host of others.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
 
Page generated in 0,04694 seconds with 9 queries