I added some custom tables to my database. I got the entries of each table to load in drop-down boxes in my form, and when the form is submitted and appears as an article in the front end, I can get the id of each of the items to show up on the article, but I can't figure out how to translate that id into the actual name.
For example, I have one table called jos_char1. In the drop down box, these are the options that appear:
Echo
November
Sierra
Victor
In the table, their ids are 1, 2, 3, 4 respectively. So if I select "November," and put this code in the On Submit form:
(among other unrelated code) the output is then "Character: 2"
I tried doing $char1->title and $char1->name but then it would just be blank. I'm not really sure what I'm doing, so I would appreciate the assistance. Thanks!
For example, I have one table called jos_char1. In the drop down box, these are the options that appear:
Echo
November
Sierra
Victor
In the table, their ids are 1, 2, 3, 4 respectively. So if I select "November," and put this code in the On Submit form:
<?php
$char1 = JRequest::getVar('char1');
$fulltext_template = "<br>
<strong>Character: </strong>$char1<br><br>";
JRequest::setVar("fulltext", $fulltext_template);
$_POST['char1'];
?>
(among other unrelated code) the output is then "Character: 2"
I tried doing $char1->title and $char1->name but then it would just be blank. I'm not really sure what I'm doing, so I would appreciate the assistance. Thanks!