PHP Classes

Update records doesn't work

Recommend this page to a friend!

      phpMyDataGrid - AJAX Enabled Datagrid  >  All threads  >  Update records doesn't work  >  (Un) Subscribe thread alerts  
Subject:Update records doesn't work
Summary:I use MySQL 4.0.20 but can't update records
Messages:6
Author:Bjarne Kallesų
Date:2006-06-10 21:57:11
Update:2007-03-04 22:51:27
 

  1. Update records doesn't work   Reply   Report abuse  
Picture of Bjarne Kallesų Bjarne Kallesų - 2006-06-10 21:57:11
Hello

Great class!
have tried your class, but I have this problem, that when I change values in the table it doesn't change in the table.
I can delete records but not change values.
What have I done wrong? Is it because I use MySQL 4.0.20?

You can try for yourself here http://www.erhvervsaffald.dk/test/phpgrid/example1.php

regards
Bjarne


  2. Re: Update records doesn't work   Reply   Report abuse  
Picture of Gustavo Arcila Gustavo Arcila - 2006-06-10 23:29:09 - In reply to message 1 from Bjarne Kallesų
Hi Bjarne


Really I don't know what can be happening... I really never try the class in mysql 4. so I can't tell you if that is the problem...

Maybe user you are using to grant access to mysql does not have enough privileges to do this...

If you like, try enabling debug mode (i cant remember if i publish this feature jet, if not, I'll publish some great changes to class in few days...)

and check permissions to user you are using... anywhere you can write to my address tavoarcila at gmail dot com .

Regards,


Gustavo

  3. Re: Update records doesn't work   Reply   Report abuse  
Picture of LE RAT LE RAT - 2006-06-29 13:53:21 - In reply to message 2 from Gustavo Arcila
Its probably because of the column name with "-" (name-en or name-es).
I find a solution by putting "`" between columns in the phpmydatagrid.inc.
example => $inscampos = $inscampos. "`".$campo."`, ";


  4. bug fixes   Reply   Report abuse  
Picture of LE RAT LE RAT - 2006-06-29 14:07:46 - In reply to message 3 from LE RAT
I find this aplication very handy et simlple to use and to understand. I have some little bugs to report: - Between columns names, I add reversed quote to accept special caracters in columns names (to become independant from configuration tricks) - The insert command puts 2 duplicates lines instead of one in Debug mode. - In 'normal mode', if you suppress the last line et add a new one, the commands puts 2 duplicates lines - the date mask does'nt work well when rows are retrieved.

=> The date problem is easily fixed by puting the good test in the FormatColumn function //if (substr($mask,0,4)=='0-1-2-3-4-double-float-integer-signed-count-percentage-promille') => if (substr($mask,0,4)=='date') {$datatype='date';}

=> the second bug (duplicate lines) was more tricky:
with Internet Explorer, the row was inserted twice.
why?: because the submit is done twice in 2 ways.
First: it is submitted by the form "method=get",
Second: it is submitted by javascript => "this.form.submit()".
With Modzilla this bug does'nt appear.
-> solution: remove the onClick submit into the 2 printf that handle the save action in the phpMyDataGrid.inc
//src="images/save.gif" title="%s" onClick="this.form.submit();"
=> src="images/save.gif" title="%s" onClick=""

Sorry for my english (I'm french).
It's the first time I participate to a forum, I hope I'm clear enough.

  5. Re: Update records doesn't work   Reply   Report abuse  
Picture of sujith sujith - 2006-08-12 13:11:10 - In reply to message 3 from LE RAT
Yea it is surely because of that
sujithukvl@gmail.com

  6. Re: Update records doesn't work   Reply   Report abuse  
Picture of M. C. Harris M. C. Harris - 2007-03-04 22:51:27 - In reply to message 5 from sujith
I noticed that when I tried to update a row the where clause written for the update statement quoted the value of the primary key ---- which was numeric.

Some of the other problems can be cured by making sure that "<?" is followed by "php"

Also if you search for the first occurrence of "<table" in the inclusion file and put "<center>" in front of it and search for the last occurrence of "</table>" and put "</center>" after it, the entire grid will be centered on your page.

Mike Harris