php - What is resource id #170?

398

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!

315

Answer

Solution:

$result1 is a MySQL result resource. It is supposed to be like this. Your actual result is in$row1 in your code.

People are also looking for solutions to the problem: Reconstructing associative arrays in php

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.