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

  • Home
  • SEARCH
  • 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 6741325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:42:40+00:00 2026-05-26T11:42:40+00:00

<?php include (database.php); $qry = Select * from tbnam where $option like ‘%$content%’; $result=mysql_query($qry);

  • 0
    <?php

    include ("database.php");               
    $qry = "Select * from tbnam where $option like '%$content%'";
    $result=mysql_query($qry);        
    while ($row =mysql_fetch_array($result))
    {
    $id=$row['id'];
    ?>
//creating table
    <tr><?echo "<td><input type=\"checkbox\" name=\"checkbox[]\" id=\"checkbox[]\"  value=\"".$row['id']."\" /></td>";?>
    <td><? echo $row['name'];?></td>
    <td><? echo $row['address'];?></td>
    <td><? echo $row['email'];?></td>
    <td><? echo $row['telephone'];?></td>
    <td><? echo $row['problem'];?></td>
    <td><? echo $row['reply_query'];?></td>
    <td><? echo $row['type'];?></td>
    <td><? echo $row['other'];?></td></tr>
    <?php
    }
    ?>
    <input type="submit" name="search" value="Print" size="10"/>
    </form>
    </table>

how i got the checkbox values? any need of passing $id in checkbox[] array ? if yes how it is possible? help me…name=\”checkbox[“\”.$id”\”]\”

  • 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-26T11:42:41+00:00Added an answer on May 26, 2026 at 11:42 am

    By writing

    <tr><?echo "<td><input type=\"checkbox\" name=\"checkbox[]\" id=\"checkbox[]\"  value=\"".$row['id']."\" /></td>";?>
    

    you have designed a form which returns an array of values with each value corresponding to a checkbox that has been “checked”.

    In this example the POST variable that points to this array will be $_POST[‘checkbox’]. Since you have set the value of each checkbox as $row[‘id’], each element in the checkbox array will have the ‘id’ value corresponding to each checkbox that you have checked.

    You can check out these values like this:

    foreach($_POST['checkbox'] as $value)
    { 
      echo $value;
    }
    

    or simply by saying:

    echo var_dump($_POST['checkbox']);
    

    Hope this makes it clear. 🙂

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

Sidebar

Related Questions

I made a while loop in php: <?php include_once(connect.php); $search=mysql_query(SELECT * from chat ORDER
when I connect to my database I include('connect.php') the document to connect. Now I
In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
I'm trying to fetch from a MySQL Database using PHP and at the moment
Okay. I have this code on my site: <?php session_start(); include database.php; include bruger.php;
Using PHP 5.x Question, lets say I want to display results from a database.
<?php include 'db.php'; $subassetcategory = $_GET[subassetcategory]; if ($subassetcategory == all) { $sql = SELECT
I want to load data from a MySQL database to a PHP page using
I have these three files to work with: document_root/include/config.php document_root/include/database.php document_root/index.php And the relevant

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.