Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> problem z rejestracja
slawek_master
post
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 0
Dołączył: 4.01.2006

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


  1. <?php
  2. <html>
  3. <head>
  4. <title>panel rejestracji</title>
  5. </head>
  6. <body>
  7. <form action="rejestracja.php" method="POST"><br />
  8. <input type="text" name="user" size="15"><br />
  9. <input type="text" name="pass" size="15">
  10. <input type="submit" value="rejestru sie">
  11. </form>
  12. ?>



logowanie.php
  1. <?php
  2.  
  3. $connect = mysql_connect("localhost","root","krasnal" ) or die ("sprawdz połacenie z serwerem");
  4.  
  5. mysql_select_db("nauka");
  6.  
  7. var_dump($_POST);
  8. $user = $_POST['user'];
  9. $pass = $_POST['pass'];
  10. $rejestracja = "INSERT INTO logowanie VALUES ($user, $pass)";
  11. mysql_query($rejestracja) or die(mysql_error());
  12.  
  13. echo "pomyslna rejestracja";
  14. ?>



prblem w tym ze to co wpisze w user to mi poxniej wyskakuje ze nie ma takiej kolumny i nazw "user'a" ;/ nie wiem o co codzi ale chyba komende do mysql dobrze napisalem
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




musisz w tym wypadku podać nazwy kolumn.
  1. <?php
  2. $rejestracja = "INSERT INTO logowanie ('user', 'pass') VALUES ($user, $pass)";
  3. ?>


Pozdrawiam

Ten post edytował Cysiaczek 20.08.2006, 07:58:00


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
slawek_master
post
Post #3





Grupa: Zarejestrowani
Postów: 64
Pomógł: 0
Dołączył: 4.01.2006

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


podawalem tongue.gif ale poxniej wykasowalem i tego nie bylo w kodzie tongue.gif ale zapomnialem dodac '' smile.gif ale teraz tez cos nie dziala

  1. <?php
  2. Something is wrong in your syntax obok ''user', 'pass') VALUES (slawek, lolowski)' w linii 1
  3. ?>


Ten post edytował slawek_master 20.08.2006, 08:09:15
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #4





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Ehh. usuń te apostrofy z pierwszego nawiasu i dodaj w drugim i będzie działać.

A wogóle to te pola w bazie nawywają się user i pass? czy inaczej?

Ten post edytował Cysiaczek 20.08.2006, 08:25:53


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
slawek_master
post
Post #5





Grupa: Zarejestrowani
Postów: 64
Pomógł: 0
Dołączył: 4.01.2006

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


juz dziala:)
  1. <?php
  2. $rejestracja = "INSERT INTO logowanie (user, pass) VALUES ('$user', '$pass')";
  3. ?>


dzieki @Cysiaczek smile.gif
Go to the top of the page
+Quote Post

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 Aktualny czas: 21.08.2025 - 06:42