PLEASE HELP! Fatal error: Call to undefined function: sqlact()
10-02-2007, 07:07 AM
|
PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 19
|
Hi Guys,
I am trying to get a freelance script to work. The listing dates and times do not refresh due to cron.php not running.
I receive this error: Fatal error: Call to undefined function: sqlact() in /home/user/public_html/cron.php on line 4
Can someone please tell me if they see an error here or atleast give me some info as to why it is happening? Any help would be great!
Here is the cron.php file:
Code:
<?php
$today = date("Ymd");
if ($lastday !== $today) {
$prgmrs = SQLact("query", "SELECT * FROM freelancers_programmers");
while ($row=SQLact("fetch_array", $prgmrs))
{
$gettra = SQLact("query", "SELECT * FROM freelancers_transactions WHERE username='" . $row[username] . "' AND type='freelancer' ORDER BY date2 DESC LIMIT 0,1");
$getbal = SQLact("result", $gettra,0,"balance");
$getdat = SQLact("result", $gettra,0,"date2");
$tt = time();
$tf = $tt-$getdat;
$aa = round($tf/((24 * 60) * 60));
$expdays = explode('-', $balexpdays);
for ($i=0;$i<count($expdays);$i++) {
if ($getbal<0.00 && $aa==$expdays[$i]) {
$to = $row[email];
$subject = $companyname . ' Account Balance Low';
$message = 'Your ' . $freelancer . ' account balance at ' . $companyname . ' has now been below ' . $currencytype . '' . $currency . '0.00 for ' . $expdays[$i] . ' days. This e-mail is sent to notify you that your account will be suspended if your balance remains below ' . $currencytype . '' . $currency . '0.00 for more than ' . $balmaxdays . ' consecutive days. You should add funds to your account to avoid this.';
mail($to,$subject,$message,"From: $emailaddress");
} else if ($getbal<0.00 && $aa>=$balmaxdays) {
$to2 = $row[email];
$subject2 = $companyname . ' Account Suspended';
$message2 = 'Your ' . $freelancer . ' account balance at ' . $companyname . ' has now been below ' . $currencytype . '' . $currency . '0.00 for ' . $balmaxdays . ' days. Unfortunately, you will not be able to place any new bids, and access many webpages within our website until you add funds to your account.';
mail($to2,$subject2,$message2,"From: $emailaddress");
SQLact("query", "INSERT INTO freelancers_suspends (ip, reason) VALUES ('" . $row[ip] . "', 'You have been suspended because of an account balance lower than " . $currencytype . "" . $currency . "0.00 for " . $balmaxdays . " or more consecutive days and you will remain suspended until you add funds to your account. Check your email for more information.')");
} else {}
}
}
$wbstrs = SQLact("query", "SELECT * FROM freelancers_webmasters");
while ($row3=SQLact("fetch_array", $wbstrs)) {
$gettra3 = SQLact("query", "SELECT * FROM freelancers_transactions WHERE username='" . $row3[username] . "' AND type='buyer' ORDER BY date2 DESC LIMIT 0,1");
$getbal3 = SQLact("result", $gettra3,0,"balance");
$getdat3 = SQLact("result", $gettra3,0,"date2");
$tt3 = time();
$tf3 = $tt3-$getdat3;
$aa3 = round($tf3/((24 * 60) * 60));
$expdays3 = explode('-', $balexpdays);
for ($i3=0;$i3<count($expdays3);$i3++) {
if ($getbal3<0.00 && $aa3==$expdays3[$i3]) {
$to3 = $row3[email];
$subject3 = $companyname . ' Account Balance Low';
$message3 = 'Your ' . $buyer . ' account balance at ' . $companyname . ' has now been below ' . $currencytype . '' . $currency . '0.00 for ' . $expdays3[$i] . ' days. This e-mail is sent to notify you that your account will be suspended if your balance remains below ' . $currencytype . '' . $currency . '0.00 for more than ' . $balmaxdays . ' consecutive days. You should add funds to your account to avoid this.';
mail($to3,$subject3,$message3,"From: $emailaddress");
} else if ($getbal3<0.00 && $aa3>=$balmaxdays) {
$to23 = $row3[email];
$subject23 = $companyname . ' Account Suspended';
$message23 = 'Your ' . $buyer . ' account balance at ' . $companyname . ' has now been below ' . $currencytype . '' . $currency . '0.00 for ' . $balmaxdays . ' days. Unfortunately, you will not be able to place any new bids, and access many webpages within our website until you add funds to your account.';
mail($to23,$subject23,$message23,"From: $emailaddress");
SQLact("query", "INSERT INTO freelancers_suspends (ip, reason) VALUES ('" . $row3[ip] . "', 'You have been suspended because of an account balance lower than " . $currencytype . "" . $currency . "0.00 for " . $balmaxdays . " or more conescutive days and you will remain suspended until you add funds to your account. Check your email for more information.')");
} else {}
}
}
$projects = SQLact("query", "SELECT * FROM freelancers_projects");
while ($row7=SQLact("fetch_array", $projects)) {
$secondsPerDay = ((24 * 60) * 60);
$timeStamp = time();
$daysUntilExpiry = $row7[expires];
$expiry = $timeStamp + ($daysUntilExpiry * $secondsPerDay);
if ($expiry==0) {
$stat = '(less than a day left)';
} else if ($expiry >= 1) {
$stat = '(' . ( $expiry - $timeStamp ) / $secondsPerDay . ' day';
if ($expiry==1) {} else {
$stat .= 's';
}
$stat .= ' left)';
} else {
$stat = '(expired)';
}
if ($stat == "(expired)") {
$tik = SQLact("query", "SELECT * FROM freelancers_webmasters WHERE username='" . $row7[creator] . "'");
$to2 = SQLact("result", $tik,0,"email");
$subject2 = $companyname . ' Project Frozen';
$message2 = 'Your ' . $companyname . ' project, named "' . $row7[project] . '", has past its due date and has been "frozen". This means no ' . $freelancers . ' can place any new bids, and an action is now required on your part. Login to the account management area at ' . $companyname . '. There are 3 things you can do now: pick a ' . $freelancer . ' for this project, extend the due date of the project (and bidding will continue), or cancel this project.';
mail($to2,$subject2,$message2,"From: $emailaddress");
SQLact("query", "UPDATE freelancers_projects SET status='frozen' WHERE id='" . $row7[id] . "'");
} else {}
}
SQLact("query", "UPDATE freelancers_cron SET lastday=$today");
} else {}
?>
__________________
Alan
Last edited by yourwebsitehere; 10-02-2007 at 07:13 AM..
|
|
|
|
10-02-2007, 10:13 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 2,815
Name: Matt
Location: Irvine, CA
|
I don't see a definition for the SQLact function anywhere. I'm guessing that's your problem. What is it you expect SQLact to do?
|
|
|
|
10-02-2007, 10:56 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 19
|
Thanks for the reply.
The cron.php is referenced in multiple files (like index.php) in the script package.
ie:
<?
require "cron.php";
?>
I cannot find a reference to:
$prgmrs = SQLact("query", "SELECT * FROM freelancers_programmers");
What else can I look for?
__________________
Alan
|
|
|
|
10-02-2007, 11:42 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 134
|
do you have a file called act.php in your script ? if so put this line on top of your cron.php file : require ("act.php");
__________________
Please login or register to view this content. Registration is FREE
Check out the Facebook Clone build with Jcow SNS at Please login or register to view this content. Registration is FREE , it is free and it always will be
|
|
|
|
10-02-2007, 11:50 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 19
|
Hi Falcone,
I do have that file so I did as you said and received the following error when going to index.php:
Fatal error: Cannot redeclare sqlact() (previously declared in /home/user/public_html/act.php:3) in /home/user/public_html/act.php on line 3
Any ideas?
__________________
Alan
|
|
|
|
10-02-2007, 11:53 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 134
|
ok, try the require_once function instead of require function
__________________
Please login or register to view this content. Registration is FREE
Check out the Facebook Clone build with Jcow SNS at Please login or register to view this content. Registration is FREE , it is free and it always will be
|
|
|
|
10-02-2007, 11:54 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 19
|
Here are two files that seem to be of importance. There is also a sql.php file but it only contains some simple variables to connect to the database.
Here is act.php
PHP Code:
<?php function SQLact ($reaction, $revalue, $revalue2="", $revalue3="") { if ($sql_mode==2) { if ($reaction == "query") { return @pg_exec($crishn, $revalue); } else if ($reaction == "result") { return @pg_result($revalue,$revalue2,$revalue3); } else if ($reaction == "num_rows") { return @pg_numrows($revalue); } else if ($reaction == "fetch_array") { return @pg_fetch_array($revalue); } } else if ($sql_mode==3) { if ($reaction == "query") { return @mssql_query($revalue); } else if ($reaction == "result") { return @mssql_result($revalue,$revalue2,$revalue3); } else if ($reaction == "num_rows") { return @mssql_num_rows($revalue); } else if ($reaction == "fetch_array") { return @mssql_fetch_array($revalue); } } else if ($sql_mode==4) { if ($reaction == "query") { return @odbc_exec($crishn, $revalue); } else if ($reaction == "result") { return @odbc_result($revalue,$revalue2,$revalue3); } else if ($reaction == "num_rows") { return @odbc_num_rows($revalue); } else if ($reaction == "fetch_array") { return @odbc_fetch_array($revalue); } } else { if ($reaction == "query") { return @mysql_query($revalue); } else if ($reaction == "result") { return @mysql_result($revalue,$revalue2,$revalue3); } else if ($reaction == "num_rows") { return @mysql_num_rows($revalue); } else if ($reaction == "fetch_array") { return @mysql_fetch_array($revalue); } } } ?>
And here is vars.php
PHP Code:
<?php require "sql.php"; require "act.php"; if ($sql_mode==2) { $crishn = pg_connect("$sql_host","5432","$sql_data"); } else if ($sql_mode==3) { $crishn = mssql_connect($sql_host, $sql_user, $sql_pass); $crashn = mssql_select_db($sql_data); } else if ($sql_mode==4) { $crishn = odbc_connect($sql_data, $sql_user, $sql_pass); } else { $crishn = mysql_connect($db_host, $db_user, $db_pass); $crashn = mysql_select_db($db_name); } $freelancers_count = SQLact("query", "SELECT * FROM freelancers_count"); $count = SQLact("result", $freelancers_count,0,"count"); $freelancers_cron = SQLact("query", "SELECT * FROM freelancers_cron"); $lastday = SQLact("result", $freelancers_cron,0,"lastday"); $freelancers_setup = SQLact("query", "SELECT * FROM freelancers_setup"); $siteurl = SQLact("result", $freelancers_setup,0,"siteurl"); $toplayout = SQLact("result", $freelancers_setup,0,"toplayout"); $bottomlayout = SQLact("result", $freelancers_setup,0,"bottomlayout"); $emailheader = SQLact("result", $freelancers_setup,0,"emailheader"); $emailfooter = SQLact("result", $freelancers_setup,0,"emailfooter"); $emailaddress = SQLact("result", $freelancers_setup,0,"emailaddress"); $companyname = SQLact("result", $freelancers_setup,0,"companyname"); $fsbamount = SQLact("result", $freelancers_setup,0,"fsbamount"); $bsbamount = SQLact("result", $freelancers_setup,0,"bsbamount"); $frefamount = SQLact("result", $freelancers_setup,0,"frefamount"); $brefamount = SQLact("result", $freelancers_setup,0,"brefamount"); $address = SQLact("result", $freelancers_setup,0,"address"); $city = SQLact("result", $freelancers_setup,0,"city"); $state = SQLact("result", $freelancers_setup,0,"state"); $country = SQLact("result", $freelancers_setup,0,"country"); $zipcode = SQLact("result", $freelancers_setup,0,"zipcode"); $currency = SQLact("result", $freelancers_setup,0,"currency"); $currencytype = SQLact("result", $freelancers_setup,0,"currencytype"); $buyer = SQLact("result", $freelancers_setup,0,"buyer"); $buyers = SQLact("result", $freelancers_setup,0,"buyers"); $freelancer = SQLact("result", $freelancers_setup,0,"freelancer"); $freelancers = SQLact("result", $freelancers_setup,0,"freelancers"); $mode = SQLact("result", $freelancers_setup,0,"mode"); $adminpass = SQLact("result", $freelancers_setup,0,"adminpass"); $attachmode = SQLact("result", $freelancers_setup,0,"attachmode"); $attachmaxi = SQLact("result", $freelancers_setup,0,"attachmaxi"); $attachpath = SQLact("result", $freelancers_setup,0,"attachpath"); $attachurl = SQLact("result", $freelancers_setup,0,"attachurl"); $catname = SQLact("result", $freelancers_setup,0,"catname"); $pcat1 = SQLact("result", $freelancers_setup,0,"pcat1"); $pcat1val = SQLact("result", $freelancers_setup,0,"pcat1val"); $pcat2 = SQLact("result", $freelancers_setup,0,"pcat2"); $pcat2val = SQLact("result", $freelancers_setup,0,"pcat2val"); $pcat3 = SQLact("result", $freelancers_setup,0,"pcat3"); $pcat3val = SQLact("result", $freelancers_setup,0,"pcat3val"); $balexpdays = SQLact("result", $freelancers_setup,0,"balexpdays"); $balmaxdays = SQLact("result", $freelancers_setup,0,"balmaxdays"); $tableborder = SQLact("result", $freelancers_setup,0,"tableborder"); $tablecellsp = SQLact("result", $freelancers_setup,0,"tablecellsp"); $tablecellpa = SQLact("result", $freelancers_setup,0,"tablecellpa"); $tablecolort = SQLact("result", $freelancers_setup,0,"tablecolort"); $tablecolorh = SQLact("result", $freelancers_setup,0,"tablecolorh"); $tablecolor1 = SQLact("result", $freelancers_setup,0,"tablecolor1"); $tablecolor2 = SQLact("result", $freelancers_setup,0,"tablecolor2"); $ppemailaddr = SQLact("result", $freelancers_setup,0,"ppemailaddr"); $deposit2checkout = SQLact("result", $freelancers_setup,0,"deposit2checkout"); $depositpaypal = SQLact("result", $freelancers_setup,0,"depositpaypal"); $depositnotify = SQLact("result", $freelancers_setup,0,"depositnotify"); $depositccurl = SQLact("result", $freelancers_setup,0,"depositccurl"); $depositccper = SQLact("result", $freelancers_setup,0,"depositccper"); $depositccfee = SQLact("result", $freelancers_setup,0,"depositccfee"); $depositccpay = SQLact("result", $freelancers_setup,0,"depositccpay"); $depositccsid = SQLact("result", $freelancers_setup,0,"depositccsid"); $depositccaut = SQLact("result", $freelancers_setup,0,"depositccaut"); $depositppper = SQLact("result", $freelancers_setup,0,"depositppper"); $depositppfee = SQLact("result", $freelancers_setup,0,"depositppfee"); $depositppaut = SQLact("result", $freelancers_setup,0,"depositppaut"); $depositmail = SQLact("result", $freelancers_setup,0,"depositmail"); $depositmlfee = SQLact("result", $freelancers_setup,0,"depositmlfee"); $depositother = SQLact("result", $freelancers_setup,0,"depositother"); $feedbackcmax = SQLact("result", $freelancers_setup,0,"feedbackcmax"); $projectper = SQLact("result", $freelancers_setup,0,"projectper"); $projectfee = SQLact("result", $freelancers_setup,0,"projectfee"); $projectper2 = SQLact("result", $freelancers_setup,0,"projectper2"); $projectfee2 = SQLact("result", $freelancers_setup,0,"projectfee2"); $withdrawcfee = SQLact("result", $freelancers_setup,0,"withdrawcfee"); $withdrawpaypal = SQLact("result", $freelancers_setup,0,"withdrawpaypal"); $withdrawpfee = SQLact("result", $freelancers_setup,0,"withdrawpfee"); $withdrawwire = SQLact("result", $freelancers_setup,0,"withdrawwire"); $withdrawwfee = SQLact("result", $freelancers_setup,0,"withdrawwfee"); $withdrawother = SQLact("result", $freelancers_setup,0,"withdrawother"); $withdrawofee = SQLact("result", $freelancers_setup,0,"withdrawofee"); $withdrawonam = SQLact("result", $freelancers_setup,0,"withdrawonam"); $withdrawoins = SQLact("result", $freelancers_setup,0,"withdrawoins"); $withdrawmini = SQLact("result", $freelancers_setup,0,"withdrawmini"); $withdrawnotify = SQLact("result", $freelancers_setup,0,"withdrawnotify"); $multiplecats = SQLact("result", $freelancers_setup,0,"multiplecats"); $featuredcost = SQLact("result", $freelancers_setup,0,"featuredcost"); $mprojectdays = SQLact("result", $freelancers_setup,0,"mprojectdays"); $projectudays = SQLact("result", $freelancers_setup,0,"projectudays"); $forumnextnum = SQLact("result", $freelancers_setup,0,"forumnextnum"); $maxextend = SQLact("result", $freelancers_setup,0,"maxextend"); $userportfolio = SQLact("result", $freelancers_setup,0,"userportfolio"); $refreturn1 = SQLact("result", $freelancers_setup,0,"refreturn1"); $refreturn2 = SQLact("result", $freelancers_setup,0,"refreturn2"); ?>
__________________
Alan
|
|
|
|
10-02-2007, 11:57 AM
|
Re: PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
Posts: 19
|
Quote:
Originally Posted by Falcone
ok, try the require_once function instead of require function
|
require_once did remove the error! Thank you!
I guess I just need to wait to see if it worked?
I am guessing the cron will refresh the dates and times in the freelance script every 24 hours?
I will be very happy if it works! 
__________________
Alan
|
|
|
|
|
« Reply to PLEASE HELP! Fatal error: Call to undefined function: sqlact()
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|