Forms updating database

Forms updating database

am 22.10.2006 17:52:13 von Kathryn Gill

I;m having probs with this script. when i
click update form the values from the text boxs that javascript updates
won't be saved in the data base.
Can any1 help?
Thanks
Kat


*some code"

enctype="multipart/form-data">

">
">
">

while ($row = mysql_fetch_array($numresults)) {
?>



"
name="" value=""
disabled>
"
name="" value=""
onchange="ptotal(this.id,'',' "t_lost" . $row{'id'};?>','',' "t_played" . $row{'id'};?>')">
"
name="" value=""
onchange="ptotal('',this.id,' .. $row{'id'};?>','',' $row{'id'};?>')">
"
name="" value=""
onchange="ptotal('',' $row{'id'};?>',this.id,'',' .. $row{'id'};?>')">
"
name="" value=""
onchange="gdtotal(this.id,'',' "t_gd" . $row{'id'};?>')">
"
name="" value=" $row{'AGAINST'};?>" onchange="gdtotal(' $row{'id'};?>',this.id,'')">

"
type="text" name="" value=" $row{'GD'};?>" disabled>
"
type="text" name="" disabled value=" $row{'PTS'};?>">





Re: Forms updating database

am 23.10.2006 00:20:24 von Aggro

Kathryn Gill wrote:
> I;m having probs with this script. when i
> click update form the values from the text boxs that javascript updates
> won't be saved in the data base.
> Can any1 help?

Make your software to print out the query you are trying to use, then
make sure that your query is having the correct values. If it is, try
using that query from the mysql command line application and provide
here the query and possible error message and we might help.

If the query doesn't look correct, then the problem is not related to
MySQL and we can't help. You would get better help from javascript of
php related newsgroups in that case.

Re: Forms updating database

am 23.10.2006 00:38:16 von Jody

"Kathryn Gill" wrote in
news:NsM_g.6351$3x1.2349@fe1.news.blueyonder.co.uk:

Hi Kathryn

Where is the PHP code which actually does the insert/update ? As Aggro
suggests echo the actual SQL query and post that so we can see if there is
anything wrong in the query.

In PHP try using mysql_query($qry) or die(mysql_error());

That should print the error out to the screen (assuming you ISP doesn't
have PHP configured to supress such errors/warnings)

Otherwise just echo the result -

if (!mysql_query($sql))
echo "Error: ".mysql_error();

I always echo the query and execute it directly against mysql (using
something like PHPmyAdmin or mySQLFront. Then you can fix any syntax in
the query and get the actual query right and then paste it back in to the
PHP code.

Jody


> I;m having probs with this script. when i
> click update form the values from the text boxs that javascript
> updates won't be saved in the data base.
> Can any1 help?
> Thanks
> Kat
>

Re: Forms updating database

am 23.10.2006 14:55:54 von Kathryn Gill

Hi,
I don't seem to get an error, so i'll go to the php forum.
Thanks
Kat

"Jody" wrote in message
news:Xns986557DD1B639jodyjcsdynamixcomau@140.99.99.130...
> "Kathryn Gill" wrote in
> news:NsM_g.6351$3x1.2349@fe1.news.blueyonder.co.uk:
>
> Hi Kathryn
>
> Where is the PHP code which actually does the insert/update ? As Aggro
> suggests echo the actual SQL query and post that so we can see if there is
> anything wrong in the query.
>
> In PHP try using mysql_query($qry) or die(mysql_error());
>
> That should print the error out to the screen (assuming you ISP doesn't
> have PHP configured to supress such errors/warnings)
>
> Otherwise just echo the result -
>
> if (!mysql_query($sql))
> echo "Error: ".mysql_error();
>
> I always echo the query and execute it directly against mysql (using
> something like PHPmyAdmin or mySQLFront. Then you can fix any syntax in
> the query and get the actual query right and then paste it back in to the
> PHP code.
>
> Jody
>
>
>> I;m having probs with this script. when i
>> click update form the values from the text boxs that javascript
>> updates won't be saved in the data base.
>> Can any1 help?
>> Thanks
>> Kat
>>