How do I output SELECT COUNT query results?

Дата добавления:
29.01.2010
Последнее изменение:
никогда
Хиты:
7965
Рейтинг:
 
Голосовать:
Хорошо - Плохо

Ответ

To render SELECT COUNT SQL query results using DW Anything enter module settings as follows.

Within an SQL query, set alias for COUNT column using AS `column_name`:

SELECT COUNT(*) AS `users_count` FROM `#__users`

Include column name in template text using {column_name} format:

Total users: {users_count}

Категория

Комментарии   

 
0 # User VariableGuest 07.11.2010 15:20
Is there any way I can use a php statement to use the $user = &JFactory::getU ser() function in order to use the username variable in my sql statement?

I want to use something like this:

.

SELECT * FROM (`jos_chronofor ms_pocnumbers` LEFT OUTER JOIN `jos_chronoform s_ratingform` ON `jos_chronoform s_pocnumbers`.p ocNum = `jos_chronoform s_ratingform`.pocNum) WHERE `name` like $uname;

but am not sure where/how to implement?
Ответить | Ответить с цитатой | Цитировать
 
 
+1 # RE: User VariableAdministrator 07.11.2010 18:29
Hi Keith,

Current version (1.02) of DW Anything does not support external variables in MySQL queries.

This feature is planned to be implemented in one of the future versions.

To be the first to konw, you can subscribe to our newsmail at the bottom of our downloads page: http://factory.docwriter.ru/en/products/joomla-extensions/
Ответить | Ответить с цитатой | Цитировать
 
 
0 # How to get values from url?shambavi 21.12.2011 12:21
Is there any possibilities available to get values from url? If so please let me know...
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: How to get values from url?Administrator 21.12.2011 13:24
Hi shambavi,

No, you cannot do this, too.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: How to get values from url?Administrator 16.01.2012 17:00
By the way, version 2.0 introduces tags to access the request parameters as well. For details, see How can I access HTTP request parameters from DW Anything?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: User VariableAdministrator 15.01.2012 16:24
As of version 2.0, you can access user data using special set of tags as follows:

Цитата:
SELECT * FROM (`jos_chronofor ms_pocnumbers` LEFT OUTER JOIN `jos_chronoform s_ratingform` ON `jos_chronoform s_pocnumbers`.pocNum = `jos_chronoform s_ratingform`.pocNum) WHERE `name` like {user.username};
This way, you can access any scalar property of JUser class object for the user currently logged in to Joomla! front end.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # JOINHisham 15.09.2011 17:53
can i select and join 2 table in the query
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: JOINAdministrator 15.01.2012 16:18
Hi Hisham,

Yes, you can.

Sorry for being late with reply.
Ответить | Ответить с цитатой | Цитировать
 

Добавить комментарий


Защитный код
Обновить

SEO by Artio