Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][MYSQL]Zapytanie do bazy.
Forum PHP.pl > Forum > Przedszkole
elewator
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?
ddiceman
  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. ?>
elewator
dzieki wielkie dziala.
+pomogl
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.