Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Skasowana tabela
przemas88
post 23.09.2009, 20:45:30
Post #1





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

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


Witam mam problem. Otóż miałem bardzo fajny formularz zgłoszeniowy, jednak przez przypadek skasowałem w bazie jakieś tabele. Możecie mi podać kod do phpmyadmina, żebym wykonał i mi wszystko ok działało. Podejrzewam że w bazie skasowałem tabelę ankieta, ale zrobiłem ją i nadal coś nie tak. Adres do przeglądania tego forumularza http://www.agencja-quest.com/adm/ Oto kod z pliku administracyjnego.

  1. //Include database info
  2. include("dbconfig.php");
  3. //print("Startup... <br>");
  4.  
  5. class admin {
  6.  
  7. function admin() {
  8. //Connect to MySQL and select database
  9. $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
  10. $db = mysql_select_db(DB_NAME);
  11. //print(DB_HOST .", ". DB_NAME .", ". DB_USER . "<br>");
  12. }
  13.  
  14. function doPost($in) {
  15. // Create SQL statement
  16. $sql = sprintf("INSERT INTO ankieta VALUES (" .
  17. "'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
  18. "'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
  19. "'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
  20. "'%s', '%s', '%s', '%s', NULL );" ,
  21. $this->escape($in['imie']) , $this->escape($in['dataur']) ,
  22. $this->escape($in['zameld']) , $this->escape($in['zamieszk']) ,
  23. $this->escape($in['teldom']) , $this->escape($in['telkom']) ,
  24. $this->escape($in['email']) , $this->escape($in['pesel']) ,
  25. $this->escape($in['dowod']) , $this->escape($in['nip']) ,
  26. $this->escape($in['wykrztalc']) , $this->escape($in['imrodzic']) ,
  27. $this->escape($in['pracnauka']) , $this->escape($in['legit']) ,
  28. $this->escape($in['umcechy']) , $this->escape($in['dyspozyc']) ,
  29. $this->escape($in['wzrost']) , $this->escape($in['waga']) ,
  30. $this->escape($in['ubranie']) , $this->escape($in['biust']) ,
  31. $this->escape($in['pas']) , $this->escape($in['biodra']) ,
  32. $this->escape($in['sanepid']) , $this->escape($in['sanit']) ,
  33. $this->escape($in['bhp']) , $this->escape($in['prjazdy']) ,
  34. $this->escape($in['samoch']) , $this->escape($in['samochmarka']) ,
  35. $this->escape($in['kontotn']) , $this->escape($in['kontoadr']) ,
  36. $this->escape($in['kontonr']) , $this->escape($in['kontobank']) ,
  37. $this->escape($in['urzskarb']) , date("Y-m-d") );
  38.  
  39. $result = mysql_query($sql);
  40. //print($sql . " effect:". $result . "<br>");
  41. // Check to see if the query did what it should have and return
  42. if (mysql_affected_rows() == 1) {
  43. return array("status" => "success");
  44. } else {
  45. return array("status" => "fail");
  46. }
  47. }
  48.  
  49. function doRead($i) {
  50. // Create SQL query
  51. $sql = sprintf("SELECT * FROM `ankieta` ORDER BY id;");
  52. // Run query on database
  53. $this->result = mysql_query($sql);
  54. // Return result
  55. mysql_data_seek($this->result, $i);
  56. $this->data = mysql_fetch_array($this->result);
  57. return $this->data;
  58. }
  59.  
  60. function dele($i) {
  61. $sql = sprintf("DELETE * FROM `ankieta` WHERE `ankieta.id`=".$i." LIMIT 1;");
  62. // Run query on database
  63. $this->result = mysql_query($sql);
  64. // Return result
  65. return $this->result;
  66. }
  67.  
  68. function rows() {
  69. // Create SQL query
  70. $sql = sprintf("SELECT * FROM `ankieta`;");
  71. // Run query on database
  72. $this->result = mysql_query($sql);
  73. $this->number = mysql_num_rows($this->result);
  74. // Return result
  75. return $this->number;
  76. }
  77.  
  78. function escape($string)
  79. {
  80. }
  81. }
  82.  
  83. //$blah = new admin();
  84. //$blee['imie'] = "Cos";
  85. //$blah->doPost($blee);
  86. //$blah->doRead();


Ten post edytował przemas88 23.09.2009, 20:46:22
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: 14.08.2025 - 12:25