Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Zapytanie do bazy.
elewator
post 30.07.2008, 16:46:11
Post #1





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 30.07.2008
Skąd: Ustka

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


Witam.
Jestem poczatkujacy.
Mam pewien problem.
Zrobilem sobie formularz:
  1. <form action="add2.php" method="post">
  2. IP:<br />
  3. <input type="text" name="ip" /><br />
  4. port:<br />
  5. <input type="text" name="port" /><br />
  6. <input type="submit" value="dodaj" />
  7. </form>


i do niego zapytanie

  1. <?
  2.  
  3.  
  4. $mysql_mylink = mysql_connect(localhost, login, haslo)
  5. or die ("Cannot make the connection");
  6. or die ("Cannot connect to the database");
  7.  
  8. if (($ip) &&($port))
  9.  
  10. {
  11. $rime1 = "INSERT INTO lgsl (status, ip, q_port, c_port, s_port, type, cache, cache_time, zone, disabled) VALUES (0, $ip, $port, 0, 0, 05, 0, 0, 0, 0)";
  12. $result = mysql_query($rime1);
  13. }
  14.  
  15. ?>

lecz nic do bazy sie nie dodaje. Moglby mi ktos to poprawic?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
ddiceman
post 30.07.2008, 17:13:12
Post #2





Grupa: Zarejestrowani
Postów: 326
Pomógł: 121
Dołączył: 23.07.2008
Skąd: Wrocław

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


  1. <?
  2. $mysql_mylink = mysql_connect('localhost', 'login', 'haslo')
  3. or die ("Cannot make the connection");
  4. or die ("Cannot connect to the database");
  5.  
  6. if (($_POST['ip']) &&($_POST['port']))
  7.  
  8. {
  9. $rime1 = "INSERT INTO lgsl (status, ip, q_port, c_port, s_port, type, cache, cache_time, zone, disabled) VALUES ('0', '".$_POST['ip']."', '".$_POST['port']."', '0', '0', '05', '0', '0', '0', '0')";
  10. $result = mysql_query($rime1);
  11. }
  12.  
  13. ?>


Ten post edytował ddiceman 30.07.2008, 17:14:15
Go to the top of the page
+Quote Post
elewator
post 30.07.2008, 17:18:11
Post #3





Grupa: Zarejestrowani
Postów: 63
Pomógł: 1
Dołączył: 30.07.2008
Skąd: Ustka

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


dzieki wielkie dziala.
+pomogl
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 Wersja Lo-Fi Aktualny czas: 24.07.2025 - 16:35