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 7308783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:37:01+00:00 2026-05-28T23:37:01+00:00

I apologize if my question does not make sense. As you can see from

  • 0

I apologize if my question does not make sense. As you can see from the code below, it scans the PHP files, grabs the text between {( )} and stores it into $match.

Now what I am trying to do here is do a query on a table that looks for the column $match where the pageid is equal to the pageid from the URL and where the field(s) are not empty. So far it is only returning Array in the text areas.

Am I setting up the code correctly or am I missing something simple? I know the scanning portion is working because if I echo match I get the text between the {( )} areas. It just isn’t doing the query right for some reason. Or like I said I am missing something. Any help would be great. Please let me know if you need further information. (I am not getting any MySQL errors).

$fn = "../templates/".$templateid.".php";

$file = file_get_contents($fn);

preg_match_all("#\{\('(\w+)'\)}#", $file, $matches);   

foreach ($matches[1] as $match) 
    {
    $result = mysql_query("SELECT * FROM pages WHERE $match IS NOT NULL AND linklabel = '$pageID'") or die("Err: ".mysql_error());

    $res = mysql_fetch_array($result);
    $content = $res;
    echo " <div id='tabs-".$match."'>
           <textarea id='".$match."' name='content-".$match."' class='fieldsetstyle'>".$content."</textarea>
                     <script type='text/javascript'>
                     CKEDITOR.replace( '".$match."' );
                     </script>
           </div>";
    }
  • 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-28T23:37:02+00:00Added an answer on May 28, 2026 at 11:37 pm

    $res IS an array, so try to output the correct column, like

    echo $res['linklabel'];
    

    or try var_dump()

    var_dump($res);
    
    
    $content = $res; // Still, $content is an array, not text
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize for making my first question not the hard-hitting code-related question I was
I apologize if the question is trivial, but some googling is not leading me
I apologize if this question was already asked but I can't seem to find
I apologize in advance for the fairly simple question. I am familiar with PHP,
First of all, I wanna apologize for not so clear description of the question.
First off, I apologize if I'm not using the right terms in my question
This is a slightly abstract question, for which I apologize. I am not necessarily
I am not very familiar with Hibernate Criteria, and apologize if this question is
Im new to Web Development and its principles so apologies if my question does
Apologies for the non-programming question, but does anyone know how to get Visual Studio

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.