Jump to content

skima

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

skima's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i wrote a script that dumps into mssql from mysql. it fetches the data then create an insert query to insert into mssql. the problem am having now is that the date will always prompt me that null values not accepted even though there is data to be inserted. INSERT INTO asset ( assetcode , desc1 , type , purchdate , allocatedt , amount , modelno , regdno , make , status , comment , regdate , deptcode , allocate1 , regddate , accttype , accode , staffid , purdate , compcode) VALUES('AST56','555','555','08/01/2008','444','44','44','44','09/01/2008','555','555','02/01/2008','555',1,'01/08/2008',8.8,'888','777','09/01/2008','bssl'); i tried to unquote the date values but still same problem.
  2. getAllRef($user_id) ::: It gets the downline of the given id. i only called the getAllRef2($user_id) is that i can get its downline straight away and then, loads its downline's downline with getAllRef(); i then recurse getAllRef2() is that it will do same for the result. right now am having performance problem. the page keeps timing out each time i load it. I think the query is too much. Any advise on how i can optimize this script?
  3. hey is the code i used to solved the first problem: note** i use ADODB //to select the 2 direct referal of the currently logged in person function select2($user_id){ global $db,$user; $sql=$db->Execute("SELECT user_id FROM user WHERE sponsor='$user_id'"); if($sql->RecordCount()) { $fet=$sql->Getrows(); return $fet; }else{ return false; } } function getAllRef2($user_id){ global $db,$user; $sql=$db->Execute("SELECT user_id FROM user WHERE sponsor='$user_id' "); $my_dl=$sql->RecordCount(); while($fet=$sql->FetchRow()){ $id=$fet['user_id']; $dl=$this->getAllRef($id); $dl2=$this->getAllRef2($id); //$my_dl= $dl + $dl2; $my_dl+=$dl; } // echo "kl: $dl2"; return $my_dl ; } function selectUs($user_id){ global $db,$user; $sql=$db->Execute("SELECT user_id FROM user WHERE sponsor='$user_id' "); $my_dl=$sql->RecordCount(); while($fet=$sql->FetchRow()){ $dl=$this->getAllRef2($fet['user_id']); $my_dl+=$dl; //$this->selectUs($) } return $my_dl; } function passStage1($user_id,$stage){ global $db,$user; $tr=false; switch($stage){ //bronze case 1: break; case 2: if($this->passFeeder($user_id)){ $tr=true; } break; case 3: //silver 30 if($this->selectUs($user_id)>= 30 ){ $tr=true; } break; case 4: //Gold 30 if($this->selectUs($user_id)>= 46 ){ $tr=true; } break; case 5: //Diamond 30 if($this->selectUs($user_id)>= 62 ){ $tr=true; } break; } return $tr; } function locateStage($stage){ global $db,$user; $sql=$db->Execute("SELECT user_id FROM user "); while($fet=$sql->Fetchrow()){ $user_id=$fet['user_id']; if($stage==2){ if(!$this->passStage1($user_id,2)){ $user_id=''; }else{ $ar[]=$user_id; } } if($stage==3){ if(!$this->passStage1($user_id,3)){ $user_id=''; }else{ $ar[]=$user_id; } } if($stage==4){ if(!$this->passStage1($user_id,4)){ $user_id=''; }else{ $ar[]=$user_id; } } if($stage==5){ if(!$this->passStage1($user_id,5)){ $user_id=''; }else{ $ar[]=$user_id; } } } return $ar; }
  4. wat have done is to create a relationship with a fore number with new two numbers creating a relation so that the table can go forth. now i need a script that will add a number to the two new numbers as its progeny. example: 1 will be the sponsor of 2 and 3, 2 will be the sponsor of 4 and 5, 3 will be the sponsor of 6 and 7 ..... and so on . Now i want to check if either of this offsprings have gotten offspring for it selve if not then a a new entry to and available one which will probably have gotten offspring or less. If its got 2 offsprings then no need to assign it any offspring again.
  5. Developed an application that models a multilevel relationship. It all have five stages, the first stage creates seperate tables, while the second stage accepts entry from the first to qualify of the other tables. Now we need to track/create a relation so we can present them in a graphical format with the newest users filling the table right-to-left up-to-down. (2X3 matrix feeding 2X4 forced matrix) i already done one but not satisfactory. it lists even the ones that have not successfully completed their previous stage. Help.Suggestion.Tips will be highly appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.