| Re: Could not update data in tables |
| by shivaji on 2003/10/21 6:46:45 ya now it's working perfectly. ![]() Thanks again for your excellent support. |
| Re: Could not update data in tables |
| by Mithrandir on 2003/10/20 15:46:13 Can't update database with GET values through $xoopsDB->query Use $xoopsDB->queryF instead - but keep in mind that GET values can be given in URL... if you get the values from a form, consider using POST instead. |
| Could not update data in tables |
| by shivaji on 2003/10/20 14:56:44 I am trying to create a new module for my own purpose. I have creat a page to update some product name against product id. It's very simple task and I am able to do it using my function. But whenever I try to update using xoops's code I am unable to do it. The code is as follows:- <? include '../../mainfile.php'; // Include the page header include(XOOPS_ROOT_PATH.'/header.php'); global $xoopsDB; if ( $xoopsUser ) { $i=1; foreach ( $HTTP_GET_VARS as $k => $v ) { $arr[$i]= $v; $i++; } print $arr[1]; if(! $xoopsDB->query("UPDATE ".$xoopsDB->prefix('exchange')." SET pname='dfdfdf' where pid=".$arr[1] )) { echo "Could not update product"; } else { redirect_header("offer.php",1,_XD_DBSUCCESS); } } else { redirect_header("index.php",3,_NOPERM); exit(); } include(XOOPS_ROOT_PATH.'/footer.php'); ?> Table name exchange Table structure is: pid int(4) pname= varchar(100) Wating for reply. |