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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:20:09+00:00 2026-05-22T03:20:09+00:00

Okay so heres what I have but whenever I do this, I am returned

  • 0

Okay so heres what I have but whenever I do this, I am returned with the first record of the database:

<?php
    function getInfo($id,$slot){
        if(!$id){ return '<b>Error</b> Id Not Returned. Please contact support@site.com for more information.'; }
        $mm = mysql_query("SELECT * FROM `users` WHERE `id`='".$id."'");
        $mma = mysql_fetch_assoc($mm);
        $p = $mma[$slot];
        return $p;
        //return $id; <- Debug (Returns ID given)
    }
$post = preg_replace("/\[CallName]([^]]+)\[\/CallName\]/", getInfo('\\1',"fullname"), $post);
?>
  • 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-22T03:20:10+00:00Added an answer on May 22, 2026 at 3:20 am

    I’m surprised you’re getting anything returned…your preg_replace pattern should be giving you an error (you aren’t escaping some of your brackets). But anyways, you can’t pass a captured group to your function like that. You have to use the “e” pattern modifier (look at example #4 in the preg_replace manual

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

Sidebar

Related Questions

Okay maybe i just need another set of eyes on this, but I have
Okay, first, I'm a noob at android programming. I have taken some Java, but
Okay so I have this mode: class Posts(db.Model): rand1 = db.FloatProperty() #other models here
Alright, I know questions like this have probably been asked dozens of times, but
Okay here's the program I have typed up(stdio.h is included also): /* function main
Okay so here is my database: I have a page on my .net form
Okay i have this problem with every page i make. im not sure what
Okay, now I've got this thing I need to do with Javascript but I
Here I have written my name in main argument declaration but still this program
This should be a very simple thing to have run, but for some reason

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.