Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> usuwanie rekordu z bazy, nie moge usunac rekordu z bazy danych
dekrzycho
post 18.01.2005, 14:57:00
Post #1





Grupa: Zarejestrowani
Postów: 39
Pomógł: 0
Dołączył: 10.01.2005

Ostrzeżenie: (10%)
X----


witam. mozecie mi pomoc poniewaz nie moge usunac rekordu z bazy jesli spelniony jest warunek. oto kod jaki napisalem

Kod
if ($letter!="on")  
  {
     // Check for valid user
     $duplicate = @mysql_query("select count(*) no_of_records from newsletter where email1='$email1'");

     if (!$duplicate)
    {
        echo("Error performing query: " . mysql_error());
    }

     $row_duplicate = mysql_fetch_array($duplicate);

     if (($row_duplicate['no_of_records']) == "0")
     {
      // usuwanie rekordu
          $usun = "delete from newsletter where
                   email1='$email1'";
            //   mysql_query($sql);  
    
      if (@mysql_query($usun))
      {
        // echo("Thank you for registering");
        // echo($pageid);
        // echo($title);
        echo ("<meta http-equiv=refresh content=0;url=index.php>");
      }
      else
      {
          //echo ("This email address is already present in our database. Please check you entered the correct address. If you have, you may have already registered and do not need to register again.");
          echo ("<meta http-equiv=refresh content=0;url=index.php>");
          exit();
      }
     }
     //else
     //{
     //    echo ("Error registering user: " . mysql-error());
        //}

   }
Możecie rzucić okiem i określić co robie żle, może jakieś poprawki...
wielkie dzięki z gory
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 12:29