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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:49:03+00:00 2026-05-16T11:49:03+00:00

i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT

  • 0

i have function which is something like this

function multiple_delete($entity1,$entity2,$entity2) {

 $query = "SELECT * FROM tablename WHERE id = '4' ";
          $result = mysql_query($query);
          $row = mysql_fetch_array($result);

echo $entity1;
echo $entity2;
echo $entity3;

}

and my function call is

multiple_delete('$row[\'pic_title\']', '$row[\'pic_brief\']', '$row[\'pic_detail\']');

keeping in mind the three value which i am passing through the parameter is the entity name of particular table.

now this function will print it as the string i.e ($row[‘pic_title’], $row[‘pic_brief’]’, $row[‘pic_detail’]) and hence not parse it as the value which i want it to do. if it parse it as the value then i will be able to get the records from the database. i have tried with the combination of single quotes, doubles, with concatenation operator etc. is there any way i tell the script that do not parse it as the string instead treat it as it have been declared to fetch the value from database. does php have any function for this ? or i am going wrong with the logic.

if i skip the parameters and declare in the functions something like this.

echo $row['pic_title'];
echo $row['pic_brief'];
echo $row['pic_detail'];

it works perfectly fine . why is that when i try to achieve the same thing with the help of parameter it refuses to fetch the value from the database, and instead it returns the same declared string from the function call.

Please do not tell me that i dont need that parameter, i need it because i want it to perform the dynamic data manipulation, with regard to different tables and different table entities. and the above function is just the demonstration of my problem not the exact function. if you want to have a look at the exact function you can check here.

What is wrong with my function?

thank you

  • 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-16T11:49:04+00:00Added an answer on May 16, 2026 at 11:49 am

    Just pass the names of the columns:

    multiple_delete('pic_title', 'pic_brief', 'pic_detail');
    

    Then you can use them to access the corresponding values in the row array by using the names them as keys:

    function multiple_delete($entity1, $entity2, $entity3) {
        $query = "SELECT * FROM tablename WHERE id = '4' ";
        $result = mysql_query($query);
        $row = mysql_fetch_array($result);
        echo $row[$entity1];
        echo $row[$entity2];
        echo $row[$entity3];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function which looks something like this, it returns a noncopyable class
I have a function like this: void something(void *obj) { obj->Set(); } The compiler
Using xlwDotNet, I have created a simple function which returns one number. Sometimes, something
I'm working on a graphical application which looks something like this: while (Simulator.simulating) {
Let's say I want to have a function which reads data from the SerialPort
Let's say I have a function that looks like this: public void saveBooking(/* some
I have a function called showMessage which displays the alert message dialog. This function
I want to do something like this.. I have a update form in PHP,
I have this code which works: return form.find('input[name!=user_view]').serializeArray(); but I'd like to now also
hi i have function which is called by tinker listbox so i cannot return

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.