PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Jul 03, 2020 12:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Aug 20, 2010 4:00 pm 
Offline
Forum Newbie

Joined: Mon Aug 09, 2010 10:34 pm
Posts: 2
Hi

I bought a script awhile back that was full of bugs. The script is a lead generator and sales tracker. I have been able to fix some of the bugs, but I still can't get the autoresponder to work properly. The autoresponder is suposed to kick in when a new lead comes in and the buyer has opted to buy the lead insantly and it sends it to his email AND at the same time it sends out a autoresponder to the person who filled out the form.

I have set the script up on my server in order to test it out. I need a volunteer that would like to like to help me get it to be stable. You would have to be able to work with PHP and MySQL database.

If you would like to practice your de-bugging skills, please contact me at david@reddingbusinessdirectory.com for more information, User name, and passwords to get started.

Below is an example of part of the script that needs de-bugged. It gives an error: "supplied argument is not a valid MySQL result resource"

Thanks for your help!!
David

Syntax: [ Download ] [ Hide ]
$query="SELECT AC.usid AS cuid
                                                                 , AF.usid AS afuid
                                                                , C.cost as afcost
                                                                , C.cost*AF.ratio*AC.ratio AS ccost
                                                                , CC.lpd as lpd
                                                                , CC.emailsubject
                                                                , CO.name as company
                                                                , CO.id as coid
                            FROM account_customer AC
                                                           , customer_campaign CC
                                                           , campaign C
                                                           , account_affiliate AF
                            LEFT JOIN customer_lead CL ON CL.lid='$lid'
                                                               AND CL.usid=AC.usid
                            LEFT JOIN account A on A.id = AC.usid
                            LEFT JOIN company CO on A.company = CO.id
                            WHERE CC.usid=AC.usid
                                                                     And CC.usid not IN ($cust_id)
                                                                    AND CC.cid='$cid' AND C.id=CC.cid
                                            AND AC.pause=0            
                                            AND C.active=1
                                                            AND C.deleted=0
                                                            AND C.approved=1
                                                            AND AF.usid=C.usid
                                  AND AC.pauseuntil<'"
.date("Y-m-d H:i:s")."'  
                                                          AND C.cost*AF.ratio*AC.ratio<=AC.balance  and $filter        
                            ORDER BY CO.id, AC.lastcust"
;
                }
                else
                if($match==0)
                {
                $query="SELECT AC.usid AS cuid
                                                         , AF.usid AS afuid
                                                         , C.cost as afcost
                                                         , C.cost*AF.ratio*AC.ratio AS ccost
                                                         , CC.lpd as lpd
                                                         , CC.emailsubject
                                                         , CO.name as company
                                                         , CO.id as coid
                            FROM account_customer AC
                                                          , customer_campaign CC
                                                          , campaign C
                                                          , account_affiliate AF
                            LEFT JOIN customer_lead CL ON CL.lid='$lid'
                                                         AND CL.usid=AC.usid
                            LEFT JOIN account A on A.id = AC.usid
                            LEFT JOIN company CO on A.company = CO.id
                            WHERE CC.usid=AC.usid
                                                        And CC.usid not IN ($cust_id)
                                                        AND CC.cid='$cid' AND C.id=CC.cid
                               AND AC.pause=0            
                               AND C.active=1
                                               AND C.deleted=0
                                               AND C.approved=1
                                               AND AF.usid=C.usid
                                       AND AC.pauseuntil<'"
.date("Y-m-d H:i:s")."'
                                               AND C.cost*AF.ratio*AC.ratio<=AC.balance            
                            ORDER BY CO.id, AC.lastcust"
;
                                }
                //}
                //echo "<br>".$query;
                //exit;

            $rv=mysql_query($query,$dbc);
            //$l_cost = $ar['ccost'];
            $l_cost = $rv['afcost'];
           
//XXXXXXXXXXXXXXXXXXXXX  THE NEXT LINE GAVE AN ERROR supplied argument is not a valid MySQL result resource

            if (mysql_num_rows($rv)!=0) mysql_query("UPDATE lead SET sold = 0 WHERE id='$lid'",$dbc);

            $tcoid= "0";
//XXXXXXXXXXXXXXXXXXXXX THE NEXT LINE GIVES AN ERROR supplied argument is not a valid MySQL result resource
                 
                        for($i=0; $i<mysql_num_rows($rv); $i++)

                {
               
$ar=mysql_fetch_array($rv);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group