what i am trying to achieve here is that i want to retrieve data from Joomla’s database.. Using the code, below, i am able to connect to Joomla’s database successfully.. But the problem is, $query1 displayed this output, “resource id #170”.. We tried connecting to different tables to see if we are able to get different output, but same output appear.. So i am wondering, what does that message means? Is it somethings wrong with the code, or database or etc..
<?php
session_start();
ob_start();
?>
<html>
<head>
<body>
<?php
include 'config.php';
//This is an example opendb.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
echo $dbname;
echo ('connected successfully!!!');
?>
<?php
$query1 = "select speciesName from jos_mainDBspecies where species_id ='1'";
$result1 = mysql_query($query1) or die(mysql_error());
$row1 = mysql_fetch_assoc($result1);
extract($row1);
echo $result1;
?>
Many thanks in advance for helping!
$result1is a MySQL result resource. It is supposed to be like this. Your actual result is in$row1in your code.