--- inc/pgRegistracija.php 2001/10/02 16:18:09 1.5 +++ inc/pgRegistracija.php 2001/10/27 16:54:50 1.6 @@ -80,7 +80,7 @@ if (!$nesto && !$spec_0) $error |= 32; if (!$username) { $userok = true; $error |= 64; } if ($username) { - $sql = "SELECT user_id FROM users WHERE (username = '$username')"; + $sql = "SELECT username FROM users WHERE (username = '$username')"; $sth = $dbh->prepare($sql); if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); @@ -107,18 +107,11 @@ $drzava = $drzava ? my_quote($drzava) : "NULL"; $sql = "INSERT INTO users (titula, ime, prezime, email, zanimanje, godrod, ustanova, adresa, mjesto, drzava, newsletter, promo, username, password) VALUES ($titula, $ime, $prezime, $email2, $zanimanje, $godrod, $ustanova, $adresa, $mjesto, $drzava, ".($newsletter?"true":"false").", ".($promo?"true":"false").", $username2, '".md5($password1)."')"; $dbh->dbh_do($sql); - $sql = "SELECT currval('users_user_id_seq')::text"; - $sth = $dbh->prepare($sql); - if (!$sth) error("Cannot prepare query: \"$sql\""); - if (!$sth->execute()) error("Cannot execute query: \"$sql\""); - $row = $sth->fetchrow_array(); - $sth->finish(); - $row = array_shift($row); for ($i = 0; $i < count($specs); $i++) { if ($specs[0]["checked"]) continue; if (!$specs[$i]["checked"]) continue; if ($specs[$i]["id"] == 0) continue; - $sql = "INSERT INTO user_spec (user_id, spec_id) VALUES ($row, ".$specs[$i]["id"].")"; + $sql = "INSERT INTO user_spec (username, spec_id) VALUES ('$username2', ".$specs[$i]["id"].")"; $dbh->dbh_do($sql); } $mail = "