Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> INSERT INTO
panbobek44
post
Post #1





Grupa: Zarejestrowani
Postów: 58
Pomógł: 0
Dołączył: 16.12.2005

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $db=@mysql_connect('localhost', '***', '***');
  3. if(!$db) die("Brak połączenia z bazą danych");
  4. else
  5. {
  6. @mysql_query("set names latin2");
  7. @mysql_select_db('***');
  8. }
  9. mysql_query("INSERT INTO users VALUES ($users_id, $users_haslo, $users_nazwa, $users_mail, $users_mail, $users_adr
    es, $users_www)"
    );
  10. ?>


  1. CREATE TABLE `users` (
  2. `users_id` varchar(50) NOT NULL DEFAULT '0',
  3. `users_haslo` varchar(50) NOT NULL DEFAULT '',
  4. `users_nazwa` varchar(50) DEFAULT NULL,
  5. `users_mail` varchar(50) NOT NULL DEFAULT '',
  6. `users_adres` varchar(100) DEFAULT NULL,
  7. `users_www` varchar(100) DEFAULT NULL,
  8. PRIMARY KEY (`users_id`)
  9. ) ENGINE=MyISAM DEFAULT CHARSET=latin2;


Dlaczego nic nie jest dodawane do bazy?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Aztech
post
Post #2





Grupa: Zarejestrowani
Postów: 276
Pomógł: 3
Dołączył: 22.10.2003
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Po pierwsze masz dwa razy w 9 linijce $users_mail
a wstawienie powinno wyglądać tak:

  1. <?php
  2.  
  3. mysql_query("INSERT INTO users ('users_id', 'users_haslo', 'users_nazwa', 'users_mail', 'users_adres', 'users_www') VALUES ($users_id, $users_haslo, $users_nazwa, $users_mail, $users_adres, $users_ww
    w)"
  4.  
  5. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 4.10.2025 - 20:42