Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Dodanie rekordu do dwoch tabel
PimP517
post 21.07.2010, 20:50:40
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 21.07.2010

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


Witam mam taki skrypcik ktory dodaje rekord do amx_amxadmins i dziala ale nie moge zrobic aby skrypt dodawal takie samo "id" do drogiej tabeli
  1. <?
  2. $id=$_POST['id'];
  3. $username=$_POST['username'];
  4. $password=$_POST['password'];
  5. $access=$_POST['access'];
  6. $flags=$_POST['flags'];
  7. $nickname=$_POST['nickname'];
  8. $steamid=$_POST['steamid'];
  9. $ashow=$_POST['ashow'];
  10. $created=$_POST['created'];
  11. $expired=$_POST['expired'];
  12. $days=$_POST['days'];
  13.  
  14.  
  15. $query = "INSERT INTO `amx_amxadmins` (id, username, password, access, flags, nickname, steamid, ashow, created, expired, days) VALUES ( '$id','$username','$password','z','a','$nickname','$steamid','0','0','0','0')";
  16. $result = @mysql_query($query);
  17. $query = "INSERT INTO `amx_serwer_admins` (id, server_id, acces, stat) VALUES ( '$id','4','a','no')";
  18. $result = @mysql_query($query);
  19.  
  20. if ($result){ //jezeli nie wyst?pi?y ?adne bl?dy
  21. $message .= 'Twoje dane zosta?y dodane do bazy';
  22. }else{
  23. $message .= 'Wyst?pi? b??d. Przepraszamy za utrudnienia<br />';
  24. }
  25. if(isset($message)){
  26. echo $message;
  27. }
  28. ?>
Powód edycji: [thek]: nie ten tag bbcode!
Go to the top of the page
+Quote Post

Posty w temacie


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: 26.06.2025 - 18:29