Questions tagged [variable]

A variable is a named unit of data storage in memory.

Filter by
Sorted by
Tagged with
0
votes
2answers
210 views

PHP7.2 Undefined variable: option in … index.php with Dj-Business004 template

When I update PHP from PHP7 to PHP7.2 the website gives this error: 500 Internal Server Error This is in the Log file: [Thu Jan 24 04:44:56.061781 2019] [proxy_fcgi:error] [pid 30185:tid ...
1
vote
1answer
589 views

SQL WHERE clause with a variable (current article ID)

I am trying to do a simple calculation on two Joomla custom fields in a module. I get the article ID as a variable and want to put this in the WHERE clause to get the right custom field value. Have ...
0
votes
1answer
300 views

How to SET a user-defined MySQL variable and increment it to produce ranking values with JDatabaseQuery?

I'm trying to write this query: SET @rownumber = 0; UPDATE #__hikers SET rank = (@rownumber:=@rownumber+1) ORDER BY score DESC; like JDatabaseQuery, but still got an error. Please help UPDATE: I ...
1
vote
3answers
996 views

Params in Custom Component List View

I'm fairly new to Joomla and I'm developing my first component. I finished up the backend and I'm working on the frontend. I have most of the functionality figured out but I can't figure out how to ...
1
vote
1answer
891 views

Passing variables between a PHP module and a PHP script

I am trying to pass some variable from a PHP module (Sourcerer) to custom PHP script using Sessions method (as posted here). The method works fine between two PHP scripts but when I tried to implement ...
0
votes
0answers
80 views

Access k2 extra field from Flexi Code module

I am using the Flexi Code module to display some php in a k2 page. This k2 page has a RoomID as extra field. How can I access it as a variable inside Flexi Code?
0
votes
1answer
1k views

How to get User's Username from ID?

This is the part of the code <td> <span class="info_label"> <?php echo JText::_( "JFORMS_FIELD_CREATED_BY_USERNAME" ); ?> </span>:<br /> ...
3
votes
3answers
980 views

Pass var to jQuery script

I need to pass a php var to a jQuery script. They are in separate files, one file to php code and another file to jQuery scripts. Is there a way of doing it? I am using Joomla 3.4.1. I just need to ...
1
vote
0answers
49 views

Joomla search filter tool bar - attempt to assign property of non-object line 428 [duplicate]

In my view.html.php I set UserState Variables. One of this variables will be set like this: $app->setUserState('com_mycomponent.modelname'.'.filter.status', 1); In the layout default.php I have ...
2
votes
0answers
1k views

getUserStateFromRequest variable become empty if name starts with '.filter.'

In my view.html.php I set UserState Variables. One of this variables is set like this: $app->setUserState('com_mycomponent.modelname'.'.filter.status', 1); When I try to get the variable in the ...
2
votes
2answers
1k views

Get the menu item variable using Jinput

I am using joomla 3.3.6 and have added a menu item type variable. I want to get the value of this variable using jinput to query the database. The controller file is external so i added the ...
5
votes
2answers
837 views

Get access to php variable in Joomlas addscriptdeclaration for Javascript

How do I get access to php variables in Joomlas approach to integrate Javascripts with addScriptDeclaration? $document = JFactory::getDocument(); $variable = "test"; $document->...
5
votes
1answer
1k views

Joomla access state variable in modules

How can I access my state variables in Joomla modules? Usually I do it like $app = JFactory::getApplication(); $variable = $app->getUserState('com_mycomponent.view.filter.variable' ,'default'); ...
3
votes
1answer
108 views

Using variables from a database like source

I have a google sheet (no, the data does not need to permanently reside there.) Which contains data for T-Shirts of my design Name Source Thumbnail Commision ...
6
votes
1answer
707 views

Database query where() value is a number

As we know, any values that are defined in a database query should always be escaped in Joomla using $db->quote($value). When defining numbers as a variable, one would normally use (int) to set ...