Hi,
I have a CC that will display data from a table named "record". In this table I have some columns for example it stores the joomla username. I try to access the email adress in the joomla user table by using the username, but I dont get it to work. I have tried different soulutions.
This is code in the body of CC
"anv" is the username column in my database-table. The $v_id variable stores the current id in the loop.
Anyone have any suggestions?
I have a CC that will display data from a table named "record". In this table I have some columns for example it stores the joomla username. I try to access the email adress in the joomla user table by using the username, but I dont get it to work. I have tried different soulutions.
This is code in the body of CC
<?php
$v_id = '{id}';
$database->setQuery( "SELECT `anv` FROM `record` WHERE `id` = $v_id" );
$categories = $database->loadObjectList();
foreach($categories as $category) {
$category=($category->anv;
echo $category;
}
?>
"anv" is the username column in my database-table. The $v_id variable stores the current id in the loop.
Anyone have any suggestions?
The only thing I really need to find out is how to put {field} to a variable, for example:
The variable $name actually do return the value of {name} here, but I can't use the value for example an IF-statemant or to compare a WHERE-statement in sql.
Anyone knows how to do this?
Best regards
Markus
<?php
$name = '{name}';
?>
The variable $name actually do return the value of {name} here, but I can't use the value for example an IF-statemant or to compare a WHERE-statement in sql.
Anyone knows how to do this?
Best regards
Markus
Hi Marcus,
From memory, you should use $MyRow->id.
Be adviced though, that performing queries of your own in the body may cause issues in some cases (sorry, don't remember the specifics, but I do belive you'll find a few threads regarding this in the forum a few months back or so).
/Fredrik
From memory, you should use $MyRow->id.
Be adviced though, that performing queries of your own in the body may cause issues in some cases (sorry, don't remember the specifics, but I do belive you'll find a few threads regarding this in the forum a few months back or so).
/Fredrik
This topic is locked and no more replies can be posted.