Home | The PHP Group | PHP | Dissappearing spaces whe...
The PHP Group PHP
Problem for The PHP Group PHP

Dissappearing spaces when html page handles database data




By info675 on Apr 04, 2009

" "
I have a site that users can submit information through a form which is then posted to my database.
I then have a page where I can check that data, edit it, and then submit any changes.
On this page, if a field has had data entered that included a space (for example, '9999 9999' for a phone number) only the data before the space is retrieved from the database. What is more, if I click the update button, the data after the space is lost.
I'd really appreciate any advice on what you think it might be.
Thanks Mark Harris Sydney Australia

Solution #1

posted on Apr 04, 2009
Not Rated)

theFK1

Rank: Apprentice 
Rating: 0%, 0 votes
Mark, it sounds like when you are displaying the data back to check and edit the data, you are not including it inside of quotes.

example:

//query to grab example data
$query="select name,salary from employee";
$result=mysql_query($query)
or die("query failed!");

printf("<input type='text' value='%s'>",mysql_result($result,0,"name"));
printf("<input type='text' value='%s'>",mysql_result($result,0,"salary"));

notice in my example the "value" argument of the "<input>" command the %s for your variable is contained within single quotes.
Was this helpful?
Yes
No

Popular Solutions for The PHP Group PHP


Questions and Unsolved Problems for The PHP Group PHP


Do you recommend The PHP Group PHP?
Answer

Answer
I want to execute java command for a software which is stored on my web server with the help of... (More)

Answer
subject avaluation system php w/ mysql codes how to evaluate subject using php w/ mysql

Answer
Hi there, I am using PHP5, where i need to mail with attachement. exact thing is, am getting the... (More)

Answer
Hiya Im trying to get a collaspable panel to save state, the example I am currently using is... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:





Sponsored Links



Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Browse popular Problems
More Common Problems
Most Common Problems for:
For The PHP Group PHP:

Top Programming Tool Experts

Rank: Guru Guru  

Solutions: 418
Member Since: October 2009

Experience: Experienced a lot in computer troubleshooting. Knowledgeable about cellular phones.

Ask Me
Find more Programming Tool Experts

Top Computer & Laptop Repair

(513) 874-3306
We fix and repair laptop motherboard no video, no...
LaptopOnCall Inc.

(877) 729-0812
We connect to your computer over the Internet to...
Remote Repair


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

X
Continue
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!
Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select