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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:02:05+00:00 2026-05-18T01:02:05+00:00

The snippet of the PHP script below works for the most part… except for

  • 0

The snippet of the PHP script below works for the most part… except for the fact that $rows[from_location_1] and $rows[‘to_location_1’] are not displaying all of the data.

The data consist of building code (letters) followed by a space then floor number/room number. example: NAC 1/200A. The script is displaying only the building code (NAC)

Note: the statement: echo “$rows[from_location_1]”; show all of the data.

I’m totally stumped after trying everything I can think of and read…

Any ideas as to what’s causing it not to display all of the data and a possible get around will be greatly appreciated…

Thanks Chris

echo '<html>';
echo '<head><title> </title>';
echo '</head>';
echo '<body>';
echo '<form method=post action=xxx>';
echo '<table border=5>';
$rows= mysql_fetch_array($result);
echo '<tr>&lt;th>CIT Number&lt;/th>&lt;td>';
echo "&lt;input type=text disabled value=" . $rows['citnum'] . ">&lt;/td>&lt;/tr>";
echo '&lt;tr>&lt;th>Serial Number&lt;/th>&lt;td>';
echo "&lt;input type=text disabled value=" . $rows['sernum'] . ">&lt;/td>&lt;/tr>";
echo '&lt;tr>&lt;th>Move Date&lt;/th>&lt;td>';
echo "&lt;input type=text value=" . $rows['move_date_1'] . ">&lt;/td>&lt;/tr>";
echo '&lt;tr>&lt;th>From&lt;/th>&lt;td>';
echo "&lt;input type=text value=" . $rows[from_location_1] . ">&lt;/td>&lt;/tr>";
echo '&lt;tr>&lt;th>To&lt;/th>&lt;td>';
echo "&lt;input type=text value=" . $rows['to_location_1'] . ">&lt;/td>&lt;/tr>";
echo '&lt;tr>&lt;th>Comment&lt;/th>&lt;td>';
echo "&lt;input type=text value=" . $rows['comment_1'] . ">&lt;/td>&lt;/tr>";
echo '&lt;/td><td align="center">';
echo '&lt;/td>&lt;/tr>&lt;/table>';
echo '&lt;input type=submit value="Click To update">';
echo '&lt;/form>';
echo '&lt;/body>';
echo '&lt;/html>';
mysql_close($dbconnect);
  • 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-18T01:02:06+00:00Added an answer on May 18, 2026 at 1:02 am

    Your echo statements from the database do not have any quotes around the $rows from the database. Also you should escape values coming from the database

    change lines like

    echo "<input type=text value=" . $rows['comment_1'] . "></td></tr>";
    

    to

    echo "<input type=text value=\"" . htmlspecialchars($rows['comment_1']) . "\"></td></tr>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is my javascript code snippet. Its not running as expected, please help me
I have a PHP script that generates a list of places and I need
I have a PHP script that runs a SELECT query then immediately deletes the
I have a PHP script that inserts data into a mysql database. The table
javascript snippet : <script type=text/javascript> $(document).ready(function() { setInterval(function() { $.getJSON('notif.php', function(data) { my_var =
I have a php script that fetches data from a DB, the result set
Mid afternoon mental block. Simple PHP script to generate an HTML snippet. Will appreciate
This little PHP snippet is used to set a cookie that lets me determine
I have a PHP script that pushes the headers to allow a file to
I have this PHP snippet: <?php $colors = array('red','green','blue'); foreach ($colors as &$item) {

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.