We help IT Professionals succeed at work.
Get Started

How can i implement my own mysql query into an JOOMLA 2.5 page

Solenthaler asked
Last Modified: 2012-07-22
Must implement the following mySQL query-code into an Joomla Article:
Here is my code example (the complete code is attached) this is the ->index.php

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chained Select Boxes using PHP, MySQL and jQuery</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
      $.get("func.php", {
            func: "drop_1",
            drop_var: $('#drop_1').val()
      }, function(response){
        setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400);
          return false;

function finishAjax(id, response) {

<form action="" method="post">
    <select name="drop_1" id="drop_1">
      <option value="" selected="selected" disabled="disabled">Select a Category</option>
      <?php getTierOne(); ?>
    <span id="wait_1" style="display: none;">
    <img alt="Please Wait" src="ajax-loader.gif"/>
    <span id="result_1" style="display: none;"></span>
<?php if(isset($_POST['submit'])){
      $drop = $_POST['drop_1'];
      $tier_two = $_POST['tier_two'];
      echo "You selected ";
      echo $drop." & ".$tier_two;
<p><a href="three-tier/">View 3 Tier Select Box Example</a></p>
Is there an elegant way. I did never implement own DB Queries into Joomla.
The DB-Part is a new table in Joomlas Main DB.
1. How is the connection to the table done?
2. Is there an other issue with the DB?
3. Where must the PHP-Code be implemented?
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE