?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?Form not showing all of var
Author:??(---.subnet66.gci-net.com)
Date:???03-24-03 12:32

I am stuck on this one...

I have created a form to show a person's contact information and allow it to be edited. Once edited, then a button will allow the changes to be sent back to the MySQL db.

The problem is in the 3rd text box. If I echo the var $addr1 or $row["addr1"], after the query, the information is printed out correctly. HOWEVER, when I attempt the same to show this data in the text box, it shows only the first 4 characters.
Example (should be): 1234 My Street
Example (showing in form): 1234 //Noting here that "My Street" is missing...

Any ideas?

Here is the code:


Client Details


echo "Client Details Page

\n";
include 'connect.php'; // pull $dbcnx from here
if (!$dbcnx) { //If fail to connect, notify.
echo( "

Unable to connect to the " .
"database serverat thsi time.

" );
exit(); } else { echo ("

Connected

"); }
mysql_select_db("fod", $dbcnx); //select FOD db
if (! @mysql_select_db("fod") ) { //if cannot, notify.
echo("

Unable to locate the FOD " .
"database at this time.

" );
exit(); }
$id = $_GET["id"]; //get id posted from clientlist.php
$result = mysql_query("select * from client WHERE ID=$id");
while ($row = mysql_fetch_array($result) ) {
$fname = $row["FName"];
$lname = $row["LName"];
$addr1 = $row["Addr1"];
$addr2 = $row["Addr2"];
}

/* below... when presented this way, the address
1234 My Street, is presented properly
/*
echo ("address l1 =" . $addr1);

echo ("
" .
"

Client Edit:
" .
"First Name
" .
" Last Name
" .
/* The problem is here... Upon displaying the form, the
address is printed as:
1234
*not* 1234 My Street
*/
"Address L1
" .
"Address L2
" .
"

" .
"
");
?>


Thank you, in advance, for any ideas you can offer!
- Steven

?Topics Author? Date
?Form not showing all of var??new
Steven Rhodes 03-24-03 12:32?
?Re: Form not showing all of var??new
hizam 03-24-03 18:31?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > I am stuck on this one... > > I have created a form to show a person's contact information > and allow it to be edited. Once edited, then a button will > allow the changes to be sent back to the MySQL db. > > The problem is in the 3rd text box. If I echo the var $addr1 > or $row["addr1"], after the query, the information is printed > out correctly. HOWEVER, when I attempt the same to show this > data in the text box, it shows only the first 4 characters. > Example (should be): 1234 My Street > Example (showing in form): 1234 //Noting here that "My > Street" is missing... > > Any ideas? > > Here is the code: > > > Client Details > > > echo "Client Details Page

\n"; > include 'connect.php'; // pull $dbcnx from here > if (!$dbcnx) { //If fail to connect, notify. > echo( "

Unable to connect to the " . > "database serverat thsi time.

" ); > exit(); } else { echo ("

Connected

"); } > mysql_select_db("fod", $dbcnx); //select FOD db > if (! @mysql_select_db("fod") ) { //if cannot, notify. > echo("

Unable to locate the FOD " . > "database at this time.

" ); > exit(); } > $id = $_GET["id"]; //get id posted from clientlist.php > $result = mysql_query("select * from client WHERE ID=$id"); > while ($row = mysql_fetch_array($result) ) { > $fname = $row["FName"]; > $lname = $row["LName"]; > $addr1 = $row["Addr1"]; > $addr2 = $row["Addr2"]; > } > > /* below... when presented this way, the address > 1234 My Street, is presented properly > /* > echo ("address l1 =" . $addr1); > > echo ("
" . > "

Client Edit:
" . > "First Name SIZE=20 MAXLENGTH=100>
" . > " Last Name SIZE=20 MAXLENGTH=100>
" . > /* The problem is here... Upon displaying the form, the > address is printed as: > 1234 > *not* 1234 My Street > */ > "Address L1 SIZE=30 MAXLENGTH=100>
" . > "Address L2 SIZE=20 MAXLENGTH=100>
" . > "

" . > "
"); > ?> > > > Thank you, in advance, for any ideas you can offer! > - Steven ">??

Provided By
Phorum