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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:32:24+00:00 2026-05-27T22:32:24+00:00

I have a table in my database called agendas which is linked with another

  • 0

I have a table in my database called agendas which is linked with another table called meetings. I would like to edit the agendas table through the form but I want the current information in the agendas fields to appear on the web form.

    <?php
include 'library/connect.php';
$agenda_id = $_GET['agenda_id'];
$result = mysql_query("SELECT agenda.*, meetings.meeting_id FROM agenda INNER JOIN meetings ON agenda.meetings = meetings.meeting_id WHERE agenda_id = '$agenda_id'");

$row = mysql_fetch_array($result);
$meeting_id = $row['meeting_id'];

?>
  <form id="form1" name="form1" method="post" action="secretary_agendaSuccesful.php?agenda_id=<?php echo $agenda_id; ?>">
    <table width="666" border="1">
      <tr>
        <td width="91">Subject:</td>
        <td width="559"><span id="sprytextarea1">
          <label for="subject"></label>
         <textarea name="subject" id="subject" cols="45" rows="5" value="<? echo  $row['subject'] ?>"></textarea>
          <span class="textareaRequiredMsg">A subject is required.</span></span></td>
      </tr>
      <tr>
        <td>Duration:</td>
        <td><span id="sprytextfield1">
        <label for="duration"></label>
        <input type="text" name="duration" id="duration" value="<? echo  $row['duration'] ?>"/>
        <span class="textfieldRequiredMsg">duration in hours</span><span class="textfieldInvalidFormatMsg">Enter duration in hours</span></span></td>
      </tr>
       <td>&nbsp;</td>
        <td><input type="submit" name="submitbtn" id="submitbtn" value="Submit" /></td>
      </tr>
    </table>
  </form>

Is this the correct way to get information from a database into the fields?

  • 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-27T22:32:25+00:00Added an answer on May 27, 2026 at 10:32 pm

    this is almost correct way
    only you need is to use htmlspecialchars() function on the displayed values.

    there can be another problem – with the query itself, which prevents your data from displaying.

    and there is also obvious SQL injection

    Make your code this way

    $agenda_id = intval($_GET['agenda_id']);
    $query = "SELECT agenda.*, meetings.meeting_id FROM agenda 
              INNER JOIN meetings ON agenda.meetings = meetings.meeting_id 
              WHERE agenda_id = $agenda_id";
    $result = mysql_query($query) or trigger_error(mysql_error()." ".$query);
    

    and see if it will show any errors

    Edit
    just noticed that you are using value parameter for the <textarea> tag. This tag has different usage from others.

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

Sidebar

Related Questions

I have a database table called Posts which stores all the information regarding an
I have a table in my database called OrderItemType which has about 5 records
Lets say I have a database table called Scrape possibly setup like: UserID (int)
I have a table in database called user which has following entries. Userid FirstName
I have a database table called AllCustomersHistoryOfRecords which is table with history of all
I have 1 table in my mysql database called clubusers which lists users emails
I have a database table called Warehouse this Warehouse's linked to a Product table
I have a table in my SQL Server database called items which has a
I have table in my SQL Server database called OrderDetail which stores the order
Lets say I have a table in a sql server 2000 database called TransactionType:

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.