How to fetch info from database? - Joomla! Forum - community, help and support
i have module has forms registered members fill out. have hidden fields want module automatically fill in value user, using info user on database.
the table containing data needed are: jos_users, jos_comprofiler
the field need fetch jos_user is: username
the field need fetch jos_comprofiler are: cb_pilotid , cb_rank
what query , php fetch info , variables display results? help!
-efrain
the table containing data needed are: jos_users, jos_comprofiler
the field need fetch jos_user is: username
the field need fetch jos_comprofiler are: cb_pilotid , cb_rank
what query , php fetch info , variables display results? help!
-efrain
nevermind, figured out.
of newbies me , wish know how did it, here is:
$name, $pilot_id , $rank, hold information needed. insert in value fields of hidden form elements, used , on , forth.
of newbies me , wish know how did it, here is:code: select all
<?php
$name = $my->username;
$pilotid_query = "select cb_pilotid"
. "\n jos_comprofiler"
. "\n id = $my->id"
;
$database->setquery( $pilotid_query );
$pilot_id = $database->loadresult();
$rank_query = "select cb_rank"
. "\n jos_comprofiler"
. "\n id = $my->id"
;
$database->setquery( $rank_query );
$rank = $database->loadresult();
?>
$name, $pilot_id , $rank, hold information needed. insert in value fields of hidden form elements, used , on , forth.
Comments
Post a Comment