Link to home
Start Free TrialLog in
Avatar of carchitect
carchitect

asked on

Early answer required

Hi kapil here
i have a form and have few text fields on it and those fields are filled by database and i am using field decimal(10,2) to fill that, actually it is a currency field.
this works fine
right?
now i have given an option to modify those text field values,ok
now as user enters some new value as 100, it works fine but if user enters 1000.50 or real values (decimal) then i am unable to to get back those chnaged values on the second form where i am updating those values in tha database.
pls help me as early as possible
pls
Avatar of VGR
VGR

impossible.

Either you mis-wrote something on the way FORM.element to DB writing,
either you have a problm of comma character definition (Windows), is it '.' or ',' ?
Avatar of carchitect

ASKER

Hi VGR
i know you are very good in PHP but i am sure i have done nothin wrong with that
still i am unable to find the mistake
i can't give you the code as it contains a lot of files
so pls suggest some other reason
regards
ok
you HTML FORM fields containing "float" data in X.Y dotted notation are of type TEXT, right ?
If you change the value to anything else, what do you get in the DB ? try :
-the same value as got from the DB
-100.5
-100,5

What is the DB field type ? Have you properly converted the string (FORM field) to this DB type ? Including spaces via trim() or whatever ?
hi VGR
first thing
i have an account on MSN as carchitect@hotmail.com and on yahoo as carchitect2002@yahoo.com
thx if you can add me to ur friend's list.
now regarding my question it is very straightforwad

i have file1.php in this file i am executing a query and geeting data from DB and then in a while loop i am creating form elements with that data
like
while($row=mysql_fetch_array($sql_result))
{
echo "
<tr><td><input type=text name=rent[] value=$rent></td>
";
}

this is fine
it is displaying that data from DB on file1.php
in correct format but
but when i goto next page then it doesn't show me the contents of rent[]
this is wokring fine on local system while testing but not working when uploaded.
right sir?
now i have tried one idiot thing that while getting data from DB like select rent from DB, i am using select concat(rent,'      ') from table.
it is working
but i don't want this idiot solution
fine sir
so i hope i am able to clear my question again
regards

}
so if you do concat(rent,'      ') before displaying the values (as text) in the HTML FORM, then have you stripped those spaces before trying to write back the value in the DB ? If not, I'm afraid this explains if the DB now holds empty values in stead of numerical ones

If your system works locally (good!) but fails lamentably uploaded ;-), then first thing compare the results of php_info() on both sites.

Chances are you encounter a limitaion of your online hosting facility.

PS : in while($row=mysql_fetch_array($sql_result))
{
echo "
<tr><td><input type=text name=rent[] value=$rent></td>
";

$rent is not defined. I guess it's of the form $row["fieldname"]
so see PPS

PPS to get rid of problems, I would personally not use an array in the while loop but rather would use
while($row=mysql_fetch_array($sql_result))
{
$rent=$row["fieldname"];
echo "
<tr><td><input type=text name=locfieldname value=$rent></td>
";
Hi VGR
i have done the same thing as you are saying
i have not used an array in while loop
that was just to tell ou in a shorter way
fine...
i will do one thing will send you a zi file pls check it if it is possible for you
thx
ouaille note, strip _no_spam and nospam below (althought I already gave it unprotected here ;-)

vgraux_no_spam@easynet.nospam.be
Hi VGR
what have you written my dear
i couldn't understand that.
regards
ssolved by self
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial