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

From SQL to Excel date format
php - ajax update textfield after dropdownlist is selected not working (yii)
PHP SQLSRV return JSON
Query MySql in PHP with Symfony
Removing image from server
HTML / PHP form that creates an xml file and then uploads it to FTP
Need Advice with Unexpected File end
How to render string with variables?
Merge 2 rows into one filling empty fields
PHP websockets socket.bind() failed. Closing old php websocket
Mysql update with an incremental value
how to sending mail Using Codigniter?
How to execute PHP code to an uploaded pdf file?
Referencing Category Description in Wordpress php
How to redirect page and show message when php error on codeigniter?
function producing space charcters for the generated password

Categories

HOME
list
automapper
android-fragments
windows-10
docker-cloud
dependencies
azure-mobile-services
minecraft
phpseclib
static-analysis
azure-graph-api
solution
circleci
documentum
pm2
fullcalendar-scheduler
sql-injection
mahout-recommender
vmware-workstation
cocos2d-android
robolectric
jitsi
backtracking
sharedpreferences
generator
pymongo
intel
substring
ava
web-config-transform
docx4j
monitor
phpstorm-2016.1
delayed-job
wdk
numerics
pdfnet
django-smart-selects
praat
hypothesis-test
pyttsx
access-denied
morphline
cordova-ios
phppgadmin
freshdesk
network-protocols
dex
instafeedjs
http4s
adobe-reader
okio
ftp-client
qtcpsocket
qpixmap
apache-pig-grunt
as3-api
webgrind
ui4j
lovefield
phpquery
sqlbase
360-degrees
search-form
cache-manifest
actionpack
ocmockito
subfolder
directorysearcher
famo.us
string.format
xml-signature
windows-rt
igor
loginview
accountmanager
oxygene
lync-2010
application-blocks
hyphen
rautomation
google-code-prettify
chartfx
email-verification
monocross
mkannotation
fbml
asio
will-paginate
data-dump
database-deadlocks
nsrangeexception
winsxs
nsconnection
j2mepolish
rational-unified-process

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