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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:11:25+00:00 2026-05-29T11:11:25+00:00

i’m trying to make this form sticky but it’s not doing. What i’m trying

  • 0

i’m trying to make this form sticky but it’s not doing. What i’m trying to do is that from a previous form, the user enters some parameters and the HTML table is generated to this page, while another form is displayed to edit the data in the table shown above it. But the values are not displaying in the form below.

Please help me

PLEASE FORGIVE MY FORMATING I TYPED ON A MOBILE. Thanks for you patience.

 <?php session_start(); ?>
 <?php require 'includes/dbconnect.php' ; ?>
 <?php require 'includes/header.inc.php'; ?>

 <?php    
 $matric_no = mysql_real_escape_string($_POST['matric_no']); 

 if ($_POST['matric_no'] == "")
 {
 echo"<div id=\"contentRight\">";
 echo"<idv id=\"msg\">" ;

 echo "You didn't enter a <span style=\"color:red\">Matric Number</span>";

 echo"</div>";
 echo"</div>";
 exit();
 } 

   $query = "SELECT matric_no
                     FROM students
                     WHERE matric_no = '$_POST[matric_no]'";


   $result = mysql_query($query);

   $duplicates = mysql_num_rows($result);

   if ($duplicates < 1) 
   {

   echo"<div id=\"contentRight\">";

   echo"<idv id=\"msg\">" ;

   echo "You dont have a record for <span style=\"color:red\">$matric_no</span>" ;

   echo "</div>" ;
   echo "</div>" ;
   exit();
  }


  $result = mysql_query("SELECT matric_no, first_name, last_name, other_name
  FROM students
           WHERE matric_no = '".mysql_real_escape_string($_POST['matric_no'])."'") or die(mysql_error());


  $number_cols = mysql_num_fields($result) ;

  echo "<div id=\"contentRight\">" ;

  echo "<span class=\"header\">";

  echo "<p><b>Matric Number: ".mysql_real_escape_string($_POST['matric_no'])       ."</b></p>";

  echo "<table border = 1 , cellspacing = 0     , cellpadding = 2 bgcolor=lemonchiffon  >\n";

  echo "<tr align=center>\n";


  for ($i=0; $i<$number_cols; $i++)       
  {

  echo "<th>" . mysql_field_name($result, $i). "</th>\n";

  }

  echo "</tr>\n";

  while ($row = mysql_fetch_row($result))
  {

    echo "<tr align=center>\n";

    for ($i=0; $i<$number_cols; $i++)
    {

        echo "<td>";

        if (!isset($row[$i])) 

        {echo "NULL";}

        else

        {echo $row[$i];}

        echo "</td>\n";

        }

        echo "</tr>\n";

        }

        echo "</table>"; 
        echo"</span>" ;

        echo"</div>"; 



       ?> 

         <br />
        <?php
     while($row = mysql_fetch_array($result)){ 
     ?>

    <div id="contentRight"> 

      <p>

  Select the Score options you will like to update:

  <form action="student_update2.php" method="post"> 

   <ul>
      <li>Matric Number: &nbsp;<input             type="text" name="matric_no"   value="<?php echo $row['matric_no'] ; ?>">         </li><br/><br/> 
    <li>First Name: <input type="text"               name="first_name" value="<?php              echo $row['firts_name'] ; ?>"> </li><br       /><br/>
    <li>Last Name: <input type="text"               name="last_name"  value="<?php               echo $row['last_name'] ; ?>"> </li><br        /><br />
    <li>Other Names: <input type="text"          name="other_name" value="<?php          echo $row['other_name'] ; ?>"</li> <br       /><br />


   <input type="submit" name="submit"          value="Update" />
   <input type="hidden" name                          ="submitted" value="TRUE" />

<input name="Reset" type="reset"               value="Reset" />

   </ul>
     </div> 

       </div>   
  </form>  

  <?php
  }             
 require 'includes/footer.php'; ?>

formmatting cleaned a little

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

    Try adding this:

      $result = mysql_query("SELECT matric_no, first_name, last_name, other_name
                         FROM students
                         WHERE matric_no = '".mysql_real_escape_string($_POST['matric_no'])."'") or die(mysql_error());
    

    Above this (approx line 99):

     while ($row = mysql_fetch_array($result)){ 
     ?>
     <div id="contentRight"> 
     <p>Select the Score options you will like to update:</p>
    

    I know you have this declared once already but since you’ve already use while to cycle through the recordset already it may need to be reset.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT

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.