QCubed - A PHP5 rapid development MVC framework.
Home  |  Updates

QQuery

UpperCase querying

How do i do this with qquery:

SELECT p.name FROM person WHERE UPPERCASE(p.name) LIKE '%SS';
Referring to Person::QueryArray(QQ::Like(QQN::Person()->Name, '%SS'));

thank you in advance!!

JS Query Builder

Anyone know of any jq plugins / any other js / php approaches that create guis like http://www.icograma.com/demos/rulebuilder/?nested ?

Maybe I can hack http://www.bernardopadua.com/nestedSortables/test/nested_sortable/ to do the nesting, and just do the other controls the standard way...

I'd really like something pre-built though. Any ideas?

QQConditions and Tiny Int Fields on MySQL

Please I seem to have a problem with QQConditions and MySQL TinyInt(1) field which can hold a boolean value (0 false and 1 true)

I have this table that contains data and it has a field called 'status' that can either be set 1 or 0 to show Active or Inactive status. Now, I wish to query and list all objects in that table that are active. I proceed as follows:

$all_obj = Port::QueryArray(QQ::Equal(QQN::Port()->Portstatus, $status_bit));

Using ExpandAsArray without Association tables

Hello,
Fanatic user of qcubed here.

Have a table of questions and a table of answers. Multiple answers can be chosen for each question by each person answering the question. However, they can only make one comment to be associated with all their answers.

When I bring back the answers for a particular user, I want to bring back the comments for that user/question as well, in a single query. Is that possible with ExpandAsArray()? I don't want to use an Association table because it's not a one-to-one between answers and answer comments (that would be very inefficient).

Grouping results based on a field or group of fields

Please can someone explain to me how I can group the results of a single query based on a particular field. For example I have this: Select * from table. It produces:

Fields: Name Tag Date
1 Peter Chinese
2. Kola French
3. Henry Korean
4. Peter Arab
5. Kola Chinese
6. Dele French
7. etc etc

Now I might want to group the result using either the name field or the tag field so I get an array of arrays where the first hold the groupers while the second holds the objects or just something good.

How do I do this?

PHPLinq - alternative to QQuery?

Folks, I just came across this:

http://blog.maartenballiauw.be/post/2009/01/29/PHPLinq-040-released-on-CodePlex!.aspx