473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Displaying existing data in a text field - 2 issues

40
I am writing a PHP page to open a row of data from a MySQL database so the user can edit the data. This page mimics the inital data entry page. Everything is working so far, with the following two issues.

In both cases, the display is a text field.
Problem 1) When the data has spaces ("Barton Fink") and I display it in a textbox, it only shows "Barton." Is there a way to wrap the data so spaces don't signal and end of the data?
Problem 2) When the exisitng field is blank, the display shows part of code that follows the display value ('SIZE=32'). Is there a way to display a blank as a blank?

My partial code:
[code-php]
......
<?php
$db = mysql_connect("localhost", "root", "yeahright"); mysql_select_db("mytest",$db);
$result = mysql_query("SELECT * FROM incidents WHERE incident_id = '$_GET[id]'",$db);
$ID = $_GET['id'];
while ($myrow = mysql_fetch_array($result))
{

$other=$myrow["oth_descr"];
$pname= $myrow["person_name"];
}
mysql_close($db);
?>
[/code]
and then
[code-php]
<FORM NAME = "irform" METHOD="POST" ACTION="ir_posted.php">
<table border="0" cellpadding="0" width="100%">
<tr>
<?php echo "<td>Other:<br><INPUT TYPE=TEXT NAME='oth_descr' VALUE=".$other." SIZE=32 MAXLENGTH=25></td>"; ?>
...............
<?php echo "<td>Name:<br><INPUT TYPE=TEXT NAME='person_name' VALUE=".$pname." SIZE=32 MAXLENGTH=25></td>"; ?>
...............
</tr>
<INPUT TYPE=SUBMIT VALUE="Submit Form" >

<INPUT TYPE=RESET VALUE="Reset Form">
</FORM>
.........
[/code]
TIA,
jej1216
Jun 11 '07 #1
5 3453
epots9
1,351 Expert 1GB
[PHP]
<?php echo "<td>Other:<br><INPUT TYPE=TEXT NAME='oth_descr' VALUE='".$other."' SIZE=32 MAXLENGTH=25></td>"; ?>
...............
<?php echo "<td>Name:<br><INPUT TYPE=TEXT NAME='person_name' VALUE='".$pname."' SIZE=32 MAXLENGTH=25></td>"; ?>
[/PHP]

that will fix it displaying size.

also, is the name in one field or in 2 fields on the database?
Jun 11 '07 #2
jej1216
40
[PHP]
<?php echo "<td>Other:<br><INPUT TYPE=TEXT NAME='oth_descr' VALUE='".$other."' SIZE=32 MAXLENGTH=25></td>"; ?>
...............
<?php echo "<td>Name:<br><INPUT TYPE=TEXT NAME='person_name' VALUE='".$pname."' SIZE=32 MAXLENGTH=25></td>"; ?>
[/PHP]

that will fix it displaying size.

also, is the name in one field or in 2 fields on the database?
That took care of the blank field.

The name is one field in the db.

Thanks,

jej1216
Jun 11 '07 #3
jej1216
40
That took care of the blank field.

The name is one field in the db.

Thanks,

jej1216
That actually fixed both issues - once again, Thanks!

jej1216
Jun 11 '07 #4
jej1216
40
The last piece -- I am not able to display any text area data -- it displays as blank.
[code-php]
<?php echo "<textarea rows=11 cols=120 name=inc_descr value='".$incdescr."'></textarea>"; ?>
[/code]
The value might be "Patient stumbled on his shoelaces and fell to the floor. Staff were unable to get to the patient to break his fall."

Using the code above, the text area is blank.

Thanks,

jej1216
Jun 11 '07 #5
jej1216
40
I'm going to start a new post with this issue.

Thanks,

jej1216
Jun 12 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Nadav | last post by:
Hi, Introduction: ************************************************************ I am working on a project that should encrypt PE files ( Portable executable ), this require me to inject some...
13
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture'...
17
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
13
by: David W. Fenton | last post by:
I've been struggling the last two days with something I thought was very easy, which is to open a web page with a form on it and populate the form with data passed in a query string (either POST or...
10
by: gnewsgroup | last post by:
I've googled and tried various approaches, but could not resolve this problem. The article at MSDN: Displaying Images in a GridView Column only presents a simple case where all data (including the...
8
by: Elfae | last post by:
I have searched high and low for a sample for this, and I just can't find any. Sorry for the length! Background Information The issue revolves around setting up a system-generated increase in...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
1
by: markla | last post by:
Hi, Can someone help me understand why for the code below, when added as a "FieldTemplate" in Dynamic Data, and rendered for a field, does not trigger the "test" function and hence update the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.