Forum Moderators: coopster

Message Too Old, No Replies

Problems with select & update

         

Grenz

5:16 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



Hi
Im creating a payment script but I have problems with the calbackurl.
It seems like the SELECT function or UPDATE function is not working. Can you see any syntax error or similar?

I have tjecked the DB and there is a value under "orderid" that corresponds to $tt.

The problem is that "payed" is not set =1 but =0 (the default value)

Here is the code:

static public function payed($username,$tt){

$r = Database::query("SELECT * FROM users WHERE orderid = '$tt'");
$data = Database::fetchRow($r);

$password = Utils::getRandomString(8);
$encrypted = Utils::encrypt($data["username"],$password);

Database::query("UPDATE users SET payed=1, password = ? WHERE id = ? ",array($encrypted,$data["id"]));

self::sendWelcomeMail($data["username"],$password,$data["email"], $oid, $tt);
}

Thanks in advance :-)

blang

7:50 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



Hi Grenz- from the last post I know you're dealing with some custom code that another developer / friend did for you. My personal opinion, it would be very difficult to troubleshoot this problem without knowledge of the entire system. Is the person that created these classes not available for support?