Jump to content
Larry Ullman's Book Forums

Applying Sql Where Clause In Yii

Recommended Posts

Hi sir,

I want to filter data from database and display them.

For example if i have a table with fields (name,block...)











Now i need to display the data of only those who have the block name as B .


I am not understanding how to perform it sir. Please help me.

Link to comment
Share on other sites

I do NOT know Yii so I maybe stepping out of line with answering this but strictly for the SQL call this is what you need


SELECT * FROM 'database_name.table_name' WHERE block = 'block-b'


That will retrieve all records from the table that are categorized as being in block-b. That is strictly the SQL statement

though I do not know what form Yii would need that in.

  • Upvote 1
Link to comment
Share on other sites


  • Create New...