差分発生行の前後
無視リスト:
コミット日時:
2010/02/28 22:28:26 (14 年前)
コミッタ:
sorshi
ログメッセージ:

SQLite採用

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/install/php/accountregist.php

    r70 r94  
    5858if ($username != ""){ 
    5959$query = " 
    60 SELECT memberid ,userclass,name,passwd1  
     60SELECT count(memberid) 
    6161FROM foltia_envpolicy  
    62 WHERE foltia_envpolicy.name  = '$username'   
     62WHERE foltia_envpolicy.name  = ?   
    6363"; 
    64         $isaccountexist = m_query($con, $query, "DBクエリに失敗しました"); 
    65         $isaccountexistncount = pg_num_rows($isaccountexist); 
     64//      $isaccountexist = m_query($con, $query, "DBクエリに失敗しました"); 
     65        $isaccountexist = sql_query($con, $query, "DBクエリに失敗しました",array($username)); 
     66 
     67        $isaccountexistncount = $isaccountexist->fetchColumn(0); 
    6668 
    6769        if ($isaccountexistncount == 0){ 
     
    8587"; 
    8688        $rs = m_query($con, $query, "DBクエリに失敗しました"); 
    87         $maxrows = pg_num_rows($rs); 
    88         if ($maxrows == 0)
    89         $nextcno = 1
     89        $maxid = $rs->fetchColumn(0); 
     90        if ($maxid)
     91               $nextcno = $maxid + 1
    9092        }else{ 
    91         $rowdata = pg_fetch_row($rs, 0); 
    92         $nextcno = $rowdata[0]; 
    93         $nextcno++ ; 
     93                $nextcno = 1; 
    9494        } 
    9595 
     
    110110$query = " 
    111111insert into foltia_envpolicy   
    112 values ( '$nextcno','2','$username','$userpasswd',now(),'$remotehost')"; 
     112values ( ?,'2',?,?,now(),?)"; 
    113113//print "$query <br>\n"; 
    114         $rs = m_query($con, $query, "DBクエリに失敗しました"); 
     114//      $rs = m_query($con, $query, "DBクエリに失敗しました"); 
     115        $rs = sql_query($con, $query, "DBクエリに失敗しました",array($nextcno,$username,$userpasswd,$remotehost)); 
    115116 
    116117print "次のアカウントを登録しました。<br> 
track feed