Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Why is this query returning no data ?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Why is this query returning no data ?
#23027
Why is this query returning no data ? 12 Years, 6 Months ago Karma: 0
Hi, I am trying to load all records from the database that have been created by the current logged on user in Joomla, im not sure if its possible to have php inside a mysql query though ?, if not how would I go about doing this otherwise ?. Thanks Iain

SELECT
leadname,
businessname,
postcode,
gasoiluser,
dervuser,
kerouser,
cf_uid,
cf_id
FROM
#__chronoforms_data_addupdatelead
WHERE createdby = '<?php
$user =& JFactory::getUser(); echo $user->get('name') ; ?>'
ORDER BY
cf_created
DESC
The administrator has disabled public write access.
 
#23028
Re:Why is this query returning no data ? 12 Years, 6 Months ago Karma: 748
Hello,

It is not possible to use a PHP code inside a SQL query. Try to use the following SQL query:

Code:


SELECT
  leadname,
  businessname,
  postcode,
  gasoiluser,
  dervuser,
  kerouser,
  cf_uid,
  cf_id
FROM
  #__chronoforms_data_addupdatelead
WHERE 
  createdby = {$UserId}
ORDER BY
  cf_created DESC 



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1