Operator

Hey everyone,

I have been going through a Yii tutorial and the "=:" operator keeps being used, for example:




$criteria->condition = 'project_id=:projectID';



I just wanted to know what it was doing? I’ve tried looking for it on php.net but I’ve had no luck! :( Can someone please tell me what its doing and what its needed for?

/* moved to General Discussion */

(not a Tip, Snippet or Tutorial)

hint: "project_id = :projectID"

It’s not an operator, it’s a placeholder.


$criteria->condition = 'project_id = :projectID';

$criteria->params = array(':projectID' => $projectId);

:projectID will be replaced by $projectId.

Thanks for being so helpful.

Tsunamin, thanks for the reply! :)

Well, if it doesn’t suit you, next time i will not even give a hint.

(I’m not doing Yii programming since beginning of last year. Doing C++ and some Delphi full time and probably for a long time to come.)