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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:51:32+00:00 2026-06-03T00:51:32+00:00

On my form, I have an echo which links to the data in my

  • 0

On my form, I have an echo which links to the data in my database.
However, If it is the first time the form has been visited (no ID in the table relating to the session) the textboxes do not appear whereas they should appear but empty!
It is successful when the id links to the session and there is a row in the database (the user has already completed the form once and has come back to edit.)
I hope this makes sense. To try and be clearer, if the user is visiting the form for the first time the textareas should be there (they disappear at the moment) but be empty.

 $rs_settings = mysql_query("SELECT * from thesis WHERE user_id = $user_id;");

     <br>

  <form action="thesis.php" method="post" name="regForm" id="regForm" >

  <?php while ($row_settings = mysql_fetch_array($rs_settings)) {?>

      Title of Proposed Thesis<span class="required">*</span>

      <textarea name="thesis_Name" type="text" style="width:500px; height:150px" 

      id="thesis_Name" size="600"><?php echo $row_settings['thesis_Name']; ?>   
      </textarea>
  • 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-03T00:51:34+00:00Added an answer on June 3, 2026 at 12:51 am

    Use mysql_num_rows()

    
    <form action="thesis.php" method="post" name="regForm" id="regForm" >
    <?php
    $num_rows = mysql_num_rows($rs_settings);
    if($num_rows > 0) { ?>
    <?php while ($row_settings = mysql_fetch_array($rs_settings)) {?>
    
    //your textarea with values from database
    
    <?php } 
    } else { ?>
    //empty textares
    <textarea></textarea>
    
    <?php } ?>
    

    Did you mean someting like this

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

Sidebar

Related Questions

I have a form which is submitted using a link. However, when I try
I have populated an html form with MySQL data from a table. I have
I have form like this: <form method=POST action=<?php echo base_url() ?>admin/admin_search> <fieldset> <label for=nalozi>Nalozi</label><input
I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
I have a html form which have a select list box from which you
i have one form which have some input box and some select box. i
I have an HTML form page which I post back to itself in order
I have a form that submits through Ajax, which works perfectly at the moment.
In one of our applications, we have a script dump data from a database
The idea is that I have a form with two editable fields, data is

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.