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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:12:36+00:00 2026-05-25T16:12:36+00:00

I seriously don’t know how to do this. The user is allowed to attached

  • 0

I seriously don’t know how to do this.
The user is allowed to attached as many recipe.pdf they want.. but i don’t know how to put it inside array. Can you guys show me how?

Here’s my code.

include('connect.php');
$db = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_database);
$result = mysql_query("SELECT * FROM recipe_list");
echo "<ul>";
while ($row = mysql_fetch_row($result))
{
foreach($row as $recipe)
echo "<li>"<input type='checkbox[]' value='".$recipe."' checked /><label>".$recipe."</label></li>";
}
echo "</ul>";
mysql_free_result($result);

Next Code is the Part where I have the Email Attachments..
I seriously don’t know how to do the array part.

$file_folder = "/home/rdash/public_html/recipes/";
$recipes = array("recipe_001.pdf","recipe_002.pdf");
$files = array ($file_folder.$recipes[0], $file_folder.$recipes[1]);

In this code, i already input pdf names.
But how am i going to pull the $recipe from the first code?
I’m talking about the recipes from the query results. The one with the checkboxes.
Please help me.
If you’ll need more details. Just ask 🙂 Thanks

  • 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-25T16:12:36+00:00Added an answer on May 25, 2026 at 4:12 pm
    include('connect.php');
    $db = mysql_connect($db_host, $db_username, $db_password);
    mysql_select_db($db_database);
    $result = mysql_query("SELECT * FROM recipe_list");
    echo "<ul>";
    while ($row = mysql_fetch_row($result)){ // assume your filed name is recipe
        echo "<li><input type='checkbox' name='recipes[]' value='".$row['recipe']."' checked /><label>".$row['recipe']."</label></li>";
    }
    

    on next page you will get as $_POST, if you set your form to post, an array ($_POST['recipes']) with recipe names.

    EDIT: if you just need the array:

    $recipes = array();
    while ($row = mysql_fetch_row($result)){ // assume your filed name is recipe
        $recipes[] = $row['recipe'];
    }
    // do whatever you want with $recipes array
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seriously, I don't know what to google. Here's the thing, I like this Java-like
maybe i am wrong but i seriously i don't like the current structure of
This is probably seriously easy to solve for most of you but I cannot
I know this could boil down to a philosophical issue, so I don't mean
I know what you're thinking - oh my god, seriously, not again - but
I know I know this has been posted millions of times but I still
Seriously, it seems like every time I want to make my UI elements talk
Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but
I want to develop my next web project in C++ as FastCGI but I
I have a strange problem I don't understand... I want to do a PopupWindow

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.