Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Procedury - jak to wykonać :/
TomASS
post
Post #1





Grupa: Zarejestrowani
Postów: 1 660
Pomógł: 13
Dołączył: 9.06.2004
Skąd: Wrocław i okolice

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


Witam.
Mam taką oto sobie procedurkę MySQL:
  1. DELIMITER |
  2. CREATE PROCEDURE tomcio()
  3. BEGIN DELETE FROM np_klienci; END|
  4. DELIMITER ;

Cytat
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER |
CREATE PROCEDURE tomcio()
BEGIN DELETE FROM np_klienci' at line 1

próbuję ją wykonać w phpMyAdmin - nie działa, czytam o co chodzi, dowiaduję się, że przez phpMyAdminka nie za bardzo można procedury.

Okej, piszę skrypcik php:
  1. <?php
  2. $query = "DELIMITER |";
  3. $result = mysql_query($query);
  4. $query = "CREATE PROCEDURE tomcio()
  5. BEGIN
  6. DELETE FROM np_klienci;
  7. END|";
  8. $result = mysql_query($query);
  9.  
  10. $query = "DELIMITER ;";
  11. $result = mysql_query($query);
  12. ?>


też kiszka :/
Cytat
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER //' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '//' at line 4You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1


Czy mógłby mi ktoś pomóc?

Ten post edytował TomASS 4.02.2007, 17:14:09
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: 3.10.2025 - 03:40