Categories > TinyButStrong general >

Update field works in phpMyAdmin but fails with tbssql

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Don Bledsoe
Date: 2007-06-10
Time: 06:04

Update field works in phpMyAdmin but fails with tbssql

I have an integer field in my MySQL domains table called expiresdays.
It is updated with a value of the number of days between field expiresdate and the current date.

This works in phpMyAdmin:
UPDATE domains SET expiresdays = TO_DAYS(expiresdate) - TO_DAYS(curdate());

This fails:
$TBS->Execute('UPDATE domains SET expiresdays = TO_DAYS(expiresdate) - TO_DAYS(curdate())');
with this message:
Fatal error: Call to undefined function: execute() in /home/forefron/public_html/domtrak/index.php on line 21

What am I doing wrong?
By: Don Bledsoe
Date: 2007-06-10
Time: 06:31

Re: Update field works in phpMyAdmin but fails with tbssql

First ... I'm a dumb-dumb ... the execution SHOULD be:
$Db->Execute('UPDATE domains SET expiresdays = TO_DAYS(expiresdate) - TO_DAYS(curdate())');

It works perfectly.