Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySQL] Błąd w zapytaniu, a wykonuje to co trzeba ;/
Snap
post
Post #1





Grupa: Zarejestrowani
Postów: 75
Pomógł: 4
Dołączył: 29.05.2005

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


Witam.
Mam taki skrypt, wypisuje mi on toplisty w panelu admina. Przy edytowaniu strony wywala mi błąd w zapytaniu ale edytowane pola są wpisywane do bazy. Gdzie tu jest błąd ?

  1. <?php
  2.  
  3. if(isset($_POST['add'])) {
  4.  
  5. $xx1 = $_POST['abc'];
  6. $xx2 = $_POST['CategoryId'];
  7. $xx3 = $_POST['Google'];
  8. $xx4 = $_POST['Keywords'];
  9. $xx5 = $_POST['Description'];
  10.  
  11. $aaaa = "UPDATE Test SET CategoryId='$xx2', Google='$xx3', Keywords='$xx4' Description='$xx5' WHERE TopsiteName=$xx1";
  12.  
  13. mysql_query($aaaa) or die('Błąd');
  14.  
  15. $aaaa = "";
  16. }
  17.  
  18. else
  19. {
  20. echo ('
  21. <div class="left2">
  22. <h3>Lista stron</h3>
  23. </div>
  24. <div class="left_side2">
  25. <table>
  26. <tr>
  27. <td id="TAB1">Nazwa</td>
  28. <td id="TAB1">Google</td>
  29. <td id="TAB1">Kategoria</td>
  30. <td id="TAB1">E-mail</td>
  31. <td id="TAB1">GaduGadu</td>
  32. <td id="TAB1">Status</td>
  33. <td id="TAB1">OPCJE</td>
  34. </tr>
  35. ');
  36.  
  37. $aaaa = mysql_query("SELECT TopsiteName, CategoryId, Description, Email, GaduGadu, Verified, Key
    words, Google FROM Test ORDER BY TopSiteName ASC"
    );
  38.  while (list($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8) = mysql_fetch_array($aaaa)) {
  39. echo ('
  40. <tr>
  41. <form method="post">
  42. <input type="hidden" name="abc" value='.$a1.'>
  43. <td id="TAB2"><a href="http://www.'.$a1.'.top-site.pl/">'.$a1.'</a></td>
  44. <td id="TAB2"><input type="text" rows="1" size="55" name="Google" value="'.$a7.'"></td>
  45. <td id="TAB2"><input type="text" rows="1" size="3" name="CategoryId" value="'.$a2.'"></td>
  46. <td id="TAB2"><a href="index.php?strona=email&send='.$a4.'">'.$a4.'</a></td>
  47. <td id="TAB2"><a href="gg://'.$a5.'/">'.$a5.'</a></td>
  48. <td id="TAB2">'.$a6.'</td>
  49. <td id="TAB3" rowspan="3"><input type="submit" name="add" id="add" value="Zapisz"><input type="submit" name="del" id="del" value="Usuń"></td>
  50. </tr>
  51. <tr>
  52. <td id="TAB1" colspan="1"><b>OPIS</b></td>
  53. <td id="TAB1" colspan="5"><input type="text" rows="1" size="105" name="Description" value="'.$a3.'"></td>
  54. </tr>
  55. <tr>
  56. <td id="TAB1" colspan="1"><b>SŁOWA</b></td>
  57. <td id="TAB1" colspan="5"><input type="text" rows="1" size="105" name="Keywords" value="'.$a8.'"></td>
  58. </tr>
  59. </form>
  60. ');
  61.  } echo ('</table></div>');
  62.  }
  63.  
  64. ?>


Za każdym razem wywala mi błąd i nie czy zmieniam dane w innym formularzu a klikam w przycisk w innym zapytanie się wykonuje. Proszę o pomoc lub sugestie w jaki sposób można to innaczej napisać. Pozdrawiam Snap (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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 - 23:43