if ($error!=1){
$id_last = pg_query ("select id from accounts order by id desc");
$id_result = pg_fetch_array ($id_last);
$id_last = $id_result["id"] +1 ;
$id_get = $id_result["id"] +1 ;
//echo "$id_last";
$sql = pg_query("insert into accounts (id,username,password) values ('$id_last','$login','$login')");
$connn = pg_connect("host=youriphere dbname=ffmember user=postgres password=yourdbpassword port=5432");
$id_result = pg_fetch_array ($id_last);
$sql2 = pg_query ("insert into tb_user (mid,password,pwd,idnum) values ('$login','$login','$passcript',$id_get)");