Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][MySQL] Wrong parameter count for mysql_db_query() ?
Kamil Matysik
post 26.05.2004, 17:30:19
Post #1





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

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


Mam problem z wydawalo by sie prostym kodem.. oto jego fragment:

[php:1:eba928d7ea]<?php
$DBconnect = DBconnect();

if (!$DBconnect) {
echo $lang[error][db];
} else {

srand((double) microtime()*1000000);

$user_key=rand(99999999,9999999999999999);

do {
$user_id=rand(9,9999);
$wynik=mysql_query("select * from aff_users where user_id='$user_id'");
} while (mysql_num_rows($wynik)>0);
$reg_date=date("Y-m-d");

$zapytanie = mysql_db_query("INSERT INTO aff_users (user_id, user_name, user_surname, user_type, user_company, user_nip, user_street, user_zip, user_city, user_email, user_page, user_phone, user_gg, user_bank, user_pass, user_date, user_active, user_key) VALUES ('$user_id', '$reg_name', '$reg_surname', '$reg_type', '$reg_company', '$reg_nip', '$reg_street', '$reg_zip', '$reg_city', '$reg_email', '$reg_page', '$reg_phone', '$reg_gg', '$reg_bank', '$reg_pass', '$reg_date', '0', '$user_key')");

if (!$zapytanie) {
echo $lang[reg][reg_error];
} else {
echo $lang[reg][reg_step1];
send_mail($id,"reg_step1");
}
}

?>[/php:1:eba928d7ea]

Dane przekazywane sa z formularza. Gdy wykonuje powyzsze zapytanie SQL w PhpMyAdmin dodaje nowy rekord bez problemu.

Ten kod jednak nie dziala... wywalany jest blad:

Cytat
Warning: Wrong parameter count for mysql_db_query() in C:SERWERSTRONYppregister.php on line 18


Czemu? I jak temu zaradzic?

Prosze o pomoc....
Go to the top of the page
+Quote Post
dr_bonzo
post 26.05.2004, 17:51:11
Post #2





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


Cytat
Warning: Wrong parameter count for mysql_db_query() in C:SERWERSTRONYppregister.php on line 18


czyli:

zla ilosc parametrow w wywolaniu funkcji mysql_db_query(), sprawdz w manualu -- brakuje jeszcze identyfikatora polaczenia


--------------------
Nie lubię jednorożców.
Go to the top of the page
+Quote Post
Kamil Matysik
post 26.05.2004, 18:11:26
Post #3





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

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


Kurcze fakt... zle napisalem.. mialo bys mysql_query... i z tad ten blad. Dzieki.
Go to the top of the page
+Quote Post
rzseattle
post 26.05.2004, 18:32:02
Post #4





Grupa: Przyjaciele php.pl
Postów: 554
Pomógł: 0
Dołączył: 4.04.2002
Skąd: Tychy

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


przeniesiony z forum php


--------------------
"Real children don't go hoppity-skip unless they are on drugs."
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: 19.04.2024 - 08:19