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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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, 11 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, 11 Months ago Karma: 760
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