[pmwiki-users] pmwiki-users Digest, Vol 14, Issue 140

Ben Stallings Ben at InterdependentWeb.com
Tue Aug 29 09:18:17 CDT 2006


Bhavin wrote,

> I setup UpdateForm recipe on my wiki and code is like the given below.
> (:update form table=blogcategid fields=bcID,blogcateg where=bcID
 > "pmwiki.php?n=Blog.BlogSave":)
> Create a Blog Category: (:update text bcID :)
> Create a Blog ID: (:update text blogCateg :)
> (:update submit value="Save Data":)
> (:update end:)
> 
> it redirects alright but this one never updates my table in mysql.

Hi, Bhavin.  My best guess is that, unless your server is running 
Windows, the problem is the capital C in blogCateg.  When run on a UNIX 
server, MySQL is case-sensitive, so the names of fields in the form need 
to exactly match the names of the fields in the database.

If that doesn't fix it, my next suspicion is that the bcID field is 
causing trouble... is it the primary key field of the table?  If so, I 
recommend not allowing the user to change it.  UpdateForm was written 
under the assumption that the primary key field would be auto-increment, 
because frankly that's my preferred way to go about designing tables, 
and I haven't gotten around to testing it with other types of primary 
keys because all the tables I create have auto-increment keys.  :-)  If 
you do use an auto-increment key, make it a hidden field in the form 
rather than allowing the user to edit it.

You say the form redirects properly, but even so I'm concerned that 
UpdateForm may not be parsing your form tag correctly.  I'd recommend 
either moving the action of the form to just after the type, like this:

(:update form "pmwiki.php?n=Blog.BlogSave" ...

or adding action= to that parameter, like this:

action="pmwiki.php?n=Blog.BlogSave"

I hope this helps!  If not, let me know.  --Ben




More information about the pmwiki-users mailing list