php


Maths in JDatabaseQuery


Which syntax I should use in JDatabaseQuery for this query
SELECT
username,
num_contacts + num_interests * 10 + num_dates * 100 + num_closenesses * 1000 AS Practice
FROM aasgz_users
ORDER BY Practice DESC;
SELECT
username,
num_contacts + num_interests * 10 + num_dates * 100 + num_closenesses * 1000 AS Practice
FROM aasgz_users
ORDER BY Practice DESC;
use following,
$db = JFactory::getDbo():
$query = $db->getQuery(true);
$query->select('username,(num_contacts + (num_interests * 10) + (num_dates * 100 ) + (num_closenesses * 1000)) AS Practice')
->from('#__users')->order('Practice DESC');
$db->setQuery($query);
$result = $db->loadObjectList();
Now you will get result

Related Links

get next upcoming game, display on mondays
Javascript array of bytes to binary string?
autocomplete plugin not passing values in php jquery
Kohana 3.2 custom validation error messages for one model or a field
Mod rewrite localhost working fine, on server in PHP QUERY_STRING and $_GET empty
file_get_html is not working in amazon ec2 instance
How to make a lead have multiple opportunities on SugarCRM 6.3 CE?
can I put index.php in a subdirectory, but not display subdirectory in url?
PHP code not creating new line in rtf template
export PHPMAIL 2.0 to outlook or suggestion on different service to use(wordpress plugin?)
Add fanpage tab programatically using Facebook AP
Graph Facebook API giving cURL error when trying to post to a user's wall
auto_prepend_file for header is causing phpmyadmin and other errors
Materialized Path PHP Regex to Select Last Item
jQuery Autocomplete returns data, but not outputting it using JSONP
how to use both condition() and addcondition() for a same search model

Categories

HOME
automapper
blast
vagrant
systemd
kivy
website
apk
elisp
lvm
navigation
linker
azure-logic-apps
stack-overflow
tiff
android-externalstorage
jodatime
mahout-recommender
jaspersoft-studio
spring-shell
sharedpreferences
strophe.js
crud
hdmi
network-analysis
math.js
sparkle
fusion
copy-protection
google-play-developer-api
xenapp
instructions
windowsiot
steam-web-api
mongodb-3.4
plantuml
gsp
listjs
custom-keyboard
bootstrap-sass
buildforge
keyboard-layout
numerics
stackpanel
jslint
code-rally
widestring
tidal-scheduler
python-sounddevice
windows-store
grunt-contrib-watch
doctrine-extensions
.net-micro-framework
rm
django-static-precompiler
knockout-2.0
sonicmq
ilrepack
glassfish-4.1
mechanicalturk
openerp-6
google-shopping-api
portal
controllers
meld
android-syncadapter
highlighting
fdt
vimperator
wif4.5
webgrind
unhandled
ngcordova
algebraixlib
whitespace-language
shoes
fuseesb
r.java-file
mutators
tkx
juttle
datagridcomboboxcolumn
inequality
lmax
screwturn
code-complexity
forio-contour
fileshare
usb-flash-drive
ctp
acitree
virtual-channel
red-system
xalan
multiscaleimage
popup-blocker
first-class
firebird1.5
microblogging
servercontrol
filelock
botnet
kext
directshow.net
airprint
3des
main-method
subtext
prism-2
remote-working

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App