我所做的是我刚刚安装了flexi自定义代码模块,在我的joomla网站上使用php,我创建了一个新的数据库,而不是joomla数据库,我把代码放在下面,它已连接并给出了结果。
$rows = $result->num_rows; // Find total rows returned by database
if($rows > 0) {
$cols = 3; // Define number of columns
$counter = 1; // Counter used to identify if we need to start or end a row
$nbsp = $cols - ($rows % $cols); // Calculate the number of blank columns
$container_class = 'container-fluid'; // Parent container class name
$row_class = 'row'; // Row class name
$col_class = 'col-sm-4'; // Column class name
echo '<div class="'.$container_class.'">'; // Container open
while ($item = $result->fetch_array()) {
if(($counter % $cols) == 1) { // Check if it's new row
echo '<div class="'.$row_class.'">'; // Start a new row
}
$jid=$item['jid'];
$jdesc = $item['jdesc'];
$duration=$item['duration'];
$jobtitle=$item['jobtitle'];
echo ('<div class="'.$col_class.'">'.'<h3>'.'<a href="showjob?jid=' . $jid . ' ">' .$jobtitle . '</a>' .'</br>'.$jdesc.'<br/>'.$duration.'</h3>'.'<h5>'.$item['name'].'</h5></div>');
if(($counter % $cols) == 0) { // If it's last column in each row then counter remainder will be zero
echo '</div>'; // Close the row
}
$counter++; // Increase the counter
}
$result->free();
if($nbsp > 0) { // Adjustment to add unused column in last row if they exist
for ($i = 0; $i < $nbsp; $i++) {
echo '<div class="'.$col_class.'"> </div>';
}
echo '</div>'; // Close the row
}
echo '</div>'; // Close the container
}
?>
<?php
$conn->close();
?>
它是创建数据库连接并且还给出了结果但是结果我希望将参数发送到其他模块以显示结果如何将参数从一个模块发送到另一个模块, 最后,我想在点击链接
时将id值输入另一个模块答案 0 :(得分:0)
我解决了这个问题,问题是我们发送到另一个页面的链接它正在保存缓存,所以我只是安装了缓存管理器插件并添加了特定的页面而不想保存缓存。所以问题解决了,现在我可以轻松地从另一个模块向joomla模块发送任何参数。