Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
8 - 6 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
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.[/quote]" />

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.

Who's Online

128 user(s) are online (72 user(s) are browsing Support Forums)


Members: 0


Guests: 128


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits