Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]co w tym zapytaniu jest źle?
me123
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 21.02.2007

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


No wiec probuje wykonac takie zapytanie do bazy danych z poziomu php
  1. <?php
  2. $cfgQuery = 'INSERT INTO '.$_POST['db_prefix'].'config (cfg, adres, aadres, default_theme, site_name, 
  3. full_name, web_mail, art_limit, forum_limit, gbook_limit, smilies, search_limit,
     link_limit, down_limit, 
  4. news_limit, art_sort, link_sort, down_sort, forum2_limit, rank_2, rank_3, rank_4
    , rank_5, sess_cookie) 
  5. VALUES ("config" , "'.$_POST['www_adres'].'" , "'.$_POST['www_alias'].'" , "Default" ,
  6.  "'.$_POST['www_name'].'" , "'.$_POST['www_desc'].'" , "'.$_POST['www_email'].'" , 
  7. "10" , "20" , "20" , "on" , "10" , "10" , "10" , "15" , "date DESC" , "date DESC" , "date DESC" , 
  8. "25" , "10" , "50" , "100" , "300" , null)';
  9. mysql_query($cfgQuery);
  10. ?>
tam z baza danych jestem polaczony itd zeby bylo jasne inne zapytania sie wykonuja , a to sie niechce, co tutaj jest zle?
tak wyglada struktura bazy danych
  1. CREATE TABLE config (
  2. cfg varchar(10) NOT NULL,
  3. adres varchar(256) NOT NULL,
  4. aadres varchar(256) NOT NULL,
  5. default_theme varchar(20) NOT NULL,
  6. site_name varchar(256) NOT NULL,
  7. full_name varchar(256) NOT NULL,
  8. web_mail varchar(30) NOT NULL,
  9. art_limit int(11) NOT NULL DEFAULT '10',
  10. forum_limit int(11) NOT NULL DEFAULT '20',
  11. gbook_limit int(11) NOT NULL DEFAULT '20',
  12. smilies varchar(4) NOT NULL DEFAULT 'on',
  13. search_limit int(11) NOT NULL DEFAULT '10',
  14. link_limit int(11) NOT NULL DEFAULT '10',
  15. down_limit int(11) NOT NULL DEFAULT '10',
  16. news_limit int(11) NOT NULL DEFAULT '15',
  17. art_sort varchar(20) NOT NULL DEFAULT 'date DESC',
  18. link_sort varchar(20) NOT NULL DEFAULT 'date DESC',
  19. down_sort varchar(20) NOT NULL DEFAULT 'date DESC',
  20. forum2_limit int(11) NOT NULL DEFAULT '25',
  21. rank_2 int(11) NOT NULL DEFAULT '10',
  22. rank_3 int(11) NOT NULL DEFAULT '50',
  23. rank_4 int(11) NOT NULL DEFAULT '100',
  24. rank_5 int(11) NOT NULL DEFAULT '300',
  25. sess_cookie varchar(256) NOT NULL
  26. );



----------------
poprawiłem kod, żeby się nie rozjeżdżał
no i po przeniesieniu na Przedszkole dodałem tag
~Cienki1980


Ten post edytował Cienki1980 26.02.2007, 17:53:16
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: 23.08.2025 - 11:40