Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pomocy! Ograniczenie php/SQL ?
Is3
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 3.01.2007

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


Problem wygląda tak mam formularz html który przekazuje dane do skryptu php

Tylko , że tych pól formularza ma być koniecznie 37.

I właśnie skrypt nie działa zaczynając od 32 pola
jak jest 31 to chodzi czyli zwraca komunikat

'Rekord został dodany poprawnie' , a jak juz mam 32 pola w skrypcie ustalone do przekazania bazie sql to zamiast tego komunikatu pojawia się białe pole nie wiem jakiś ogranicznik ? coś się nie wyrabia ?

  1. <?php
  2.  
  3.  
  4. $1 = $_POST['1'];
  5. $2 = $_POST['2'];
  6. $3 = $_POST['3'];
  7. $4 = $_POST['4'];
  8. $5 = $_POST['5'];
  9. $6 = $_POST['6'];
  10. $7 = $_POST['7'];
  11. $8 = $_POST['8'];
  12. $9 = $_POST['9'];
  13. $10 = $_POST['10'];
  14. $11 = $_POST['11'];
  15. $12 = $_POST['12'];
  16. $13 = $_POST['13'];
  17. $14 = $_POST['14'];
  18. $15 = $_POST['15'];
  19. $16 = $_POST['16'];
  20. $17 = $_POST['17'];
  21. $18 = $_POST['18'];
  22. $19 = $_POST['19'];
  23. $20 = $_POST['20'];
  24. $21 = $_POST['21'];
  25. $22 = $_POST['22'];
  26. $23 = $_POST['23'];
  27. $24 = $_POST['24'];
  28. $25 = $_POST['25'];
  29. $26 = $_POST['26'];
  30. $27 = $_POST['27'];
  31. $28 = $_POST['28'];
  32. $29 = $_POST['29'];
  33. $30 = $_POST['30'];
  34. $31 = $_POST['31'];
  35.  
  36.  
  37.  
  38. if($1 and $2 and $3 and $4 and $5 and $6 and $7 and $8 and $9 and $10 and $11 and $
    12 and $13 and $14 and $15 and $16 and $17 and $18 and $19 and $20 and $21 and $2
    2 and $23 and $24 and $25 and $26 and $27 and $28 and $29 and $30 and $31) {
  39.  
  40.  
  41. $connection = @mysql_connect('localhost', 'x', 'x')
  42. or die('Brak połączenia z serwerem MySQL');
  43. $db = @mysql_select_db('x', $connection)
  44. or die('Nie mogę połączyć się z bazą danych');
  45.  
  46.  
  47.  
  48.  
  49. $query = "INSERT INTO formularz (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
    22, 23, 24, 25, 26, 27, 28, 29, 30, 31) VALUES ('$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9', '$10', '$11, '$12', '$13', '$14', '$15', '$16', '$17', '$18', '$19', '$20', '$21, '$22', '$j23', '$24', '$25', '$26', '$27', '$28', '$29', '$30', '$31')"
    ;
  50. mysql_query($query);
  51.  
  52.  
  53.  
  54. if($query) echo "Rekord został dodany poprawnie";
  55. else echo "Błąd nie udało się dodać nowego rekordu";
  56.  
  57. mysql_close($connection);
  58. }
  59.  
  60. ?>


Zamiast tych liczb Są Litery i Cyfry i czasem znak _

Przewiduje , że skrypt jest bardzo newbie , ale jak na razie lepszego mi się nie udało sklecić ..


Prosił bym o jak najszybszą odpowiedź ! na dziś to potrzebuje zrobić ;/

Ten post edytował Is3 3.01.2007, 18:32:06
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: 22.08.2025 - 20:39