Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:24:23+00:00 2026-05-27T22:24:23+00:00

I am running the following script to draw a table from results in my

  • 0

I am running the following script to draw a table from results in my database:

$user =& JFactory::getUser();

$currentUser = $user->id;

$query = "SELECT * FROM jos_modelform_submissions WHERE user_id='".$currentUser."' AND model_type='model1'";
$db->setQuery($query);
$tableResults = $db->query();

$formLayout .= $tableResults;

echo "<div style='overflow:auto;'><table border='1' cellspacing='0' cellpadding='14'>
<tr bgcolor='#0D7CCD'>";
echo "<TD style='text-align:center;color:#FFFFFF;' width='25px'><b>ID</b></TD>
<TD style='text-align:center;color:#FFFFFF;' width='40px'><b>User ID</b></TD>
<TD style='text-align:center;color:#FFFFFF;' width='200px'><b>Input</b></TD>
<TD style='text-align:center;color:#FFFFFF;' width='600px'><b>Output</b></TD>
<TD style='text-align:center;color:#FFFFFF;' width='110px'><b>Model Type</b></TD>
<TD style='text-align:center;color:#FFFFFF;' width='100px'><b>Date/Time</b></TD>
</tr>";
echo "<tr><td colspan ='6'><div style='width:1075px;height:300px;overflow:auto;'><table border='1' cellspacing='0' cellpadding='14'>";
while ($row = mysql_fetch_array($tableResults)) 
{
$mix = array("<", "/>", ">", "/");
$output1 = str_replace($mix, "#", $row['output']);
$output2 = str_replace("#", "<BR/>", $output1);
echo "<tr onclick=\"alert('Test');\" onmouseover=\"document.body.style.cursor='pointer'\" onmouseout=\"document.body.style.cursor='default'\">";
echo "<TD style='text-align:center;' width='25px'>" . $row['id'] . "</td>";
echo "<TD style='text-align:center;' width='40px'>" . $row['user_id'] . "</td>";
echo "<TD width='200px'>" . $row['input'] . "</td>";
echo "<TD width='600px'>" .stripslashes($output2). "</td>";
echo "<TD style='text-align:center;' width='110px'>" . $row['model_type'] . "</td>";
echo "<TD style='text-align:center;' width='100px'>" . $row['date_time'] . "</td>";
echo "</tr>";
}
echo "</table> </div></td></tr></table></div></br></br>";

The table presents fine but at the bottom of my page I am getting the output of the Resource ID#. How can I get rid of this? Is there an error in my syntax or logic somewhere? You can see the code running here:

http://hanseninfotech.com/rtds/index.php/modelform1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:24:24+00:00Added an answer on May 27, 2026 at 10:24 pm

    Do you echo $formLayout ?

    From your code :

    $tableResults = $db->query();
    $formLayout .= $tableResults;   // what does this line do ????
    

    echoing the return from a query() will result in the output of “Resource ###”

    echoing a file handle (returned from fopen()) will produce the same result

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running following query. SELECT T1.C1, T2.C2..., IF( T1.C1<>T2.C1,Changed,1) AS NewColumn From T1
I am running the following script: RESTORE DATABASE [Name_V2] FROM DISK = N'C:\20100920_Name_V2.bak' WITH
I am running the following script - BEGIN select department_name from egpl_department where department_id
I'm running the following test Java script from the Android HttpURLConnection docs : URL
I'm running the following Python script: #!/usr/bin/python import os,sys from scipy import stats import
I have the following script which I am running. It loops through each table
I have the following script running successfully. However if I try to use a
Running the following line in my script gives me a Permission denied error: $config_out
Running my script through Devel::NYTProf showed that the following portion of code took up
I got the following error while running my perl script with the negative lookaround

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.