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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:00:26+00:00 2026-06-16T05:00:26+00:00

I am trying to create a members table, using a PHPmyadmin database, and in

  • 0

I am trying to create a members table, using a PHPmyadmin database, and in the database, there is a 0 & 1 field, and I want to transform the 0 and 1 in a checkbox, for each member. Is an editable table, so the table might be in a form. Here is what I did:

<?php
include('../../config.php'); 

$result2 = mysql_query("SELECT * FROM acars_users");

echo "<table border='1'>
<tr>
<th>ID</th>
<th>Dados Pessoais</th>
<th>Origem</th>
<th>Dados de Redes</th>
<th width='220px'>Base</th>
<th>Patente</th>
<th>Horas</th>
<th>&Eacute; Ativo?</th>
<th>Dinheiro</th>
<th>Senha</th>
<th>Op&ccedil;&otilde;es</th>
</tr>";



while($row = mysql_fetch_array($result2)) 

  {
  echo "<tr>";
  echo "<td>" . $row['id'] . "</td>";

  echo "<td width='300px'>" . "<form action=editar.php method=POST><input name=username size=7 type=text value=".$row['username']." /></br><input name=nome size=10 type=text value=".$row['nome']." /><input name=sobrenome size=20 type=text value=".$row['sobrenome']." /></br><input name=email size=25 type=text value=".$row['email']." />" . "</td>";

  echo "<td>" . "<input name=datanascimento size=10 type=text value=".$row['datanascimento']." /></br><input name=pais size=10 type=text value=".$row['pais']." /></br><input name=cidade size=30 type=text value=".$row['cidade']." />" . "</td>";

  echo "<td>" . "IVAO:&nbsp;<input name=idivao size=8 type=text value=".$row['idivao']." /></br>VATSIM:&nbsp;<input name=idvatsim size=8 type=text value=".$row['idvatsim']." />" . "</td>";

  echo "<td>" . "<input name=base size=8 type=text value=".$row['base']." />" . "</td>";
  echo "<td>" . "<input name=rank size=10 type=text value=".$row['rank']." /></br>Admin &nbsp;<input name=admin size=1 type=checkbox value=".$row['admin']." /></br>DOV &nbsp; <input name=dov size=1 type=checkbox value=".$row['dov']." /></br>Checador &nbsp; <input name=checador size=1 type=checkbox value=".$row['checador']." />" . "</td>";
  echo "<td>" . "<input name=horas size=6 type=text value=".$row['horas']." />" . "</td>";
  echo "<td>" . "<input type=checkbox name='isactive[]' value=".$row['isactive']." />" . "</td>";
  echo "<td>" . "<input name=dinheiro size=10 type=text value=".$row['dinheiro']." />" . "</td>";
  echo "<td>" . "<input name=password size=10 type=password value=".$row['password']." />" . "</td>";
  echo "<td>" . "<input name=edit_id value=".$row['id']." type=hidden><input type=submit value=Editar ></form><form action=deletarexist.php method=POST><input name=delete_id value=".$row['id']." type=hidden><input type=submit value=Demitir></form>" . "</td>";

  echo "</tr>";
  }

echo "</table>";

?>
  • 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-06-16T05:00:27+00:00Added an answer on June 16, 2026 at 5:00 am
    $chkd=$row['isactive']?'checked="checked"':''; // 0: false; 1: true
    echo "<td><input type='checkbox' name='isactive[]' value='{$row['isactive']}' $chkd></td>";
    

    (Although, you should look into using a templatingg system (such as smarty) rather than echoing html fragments. It seems at bit weird in the start, but as soon as you get used to it, you’ll never look back-)

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

Sidebar

Related Questions

I'm trying to create a leaderboard of members on my site by using the
I'm trying to create a member page for updating account details. I want to
I'm trying to scrape thesession.org to create a table of how many times each
I'm trying to create a trigger in phpMyadmin (MySQL) I have two tables, members
I'm trying to create a lookup table of member functions in my code, but
I'm trying to parse an XMLRPC response using jQuery to create a table containing
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
I am trying to create a completely dynamic way to query entity framework using

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.