Harold,
If this is for Joomla 5 and up, I would write your code as follows:
use \Joomla\CMS\Factory;
use \Joomla\Database\ParameterType;
$db = Factory::getContainer()->get('DatabaseDriver');
$query = $db->getQuery(true)
->select($db->quoteName('version'))
->from($db->quoteName('#__mytable_products'))
->where($db->quoteName('published') . ' = :published')
->bind(':published', 1, ParameterType::INTEGER);
$db->setQuery($query);
$versions = $db->loadObjectList();
This code retrieves an array of objects stored into the array $versions. Each object in the array has one variable: version.
To list these, you can use a foreach loop:
foreach ($versions as $version) {
echo $version->version;
}
There are also other ways to retrieve the data, you can read more about that here:
https://docs.joomla.org/Selecting_data_using_JDatabase