Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> pobieranie danych do fCKeditor
istrd
post
Post #1





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 3.12.2009

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


Witam chcę zrobić edycje newsów z bazy i mam pytanie jak pobrać treść wysłanego już wczesniej do bazy newsa do FCKeditor (IMG:style_emoticons/default/questionmark.gif)
Próbowałem tak ale edytor nie chce się pokazać.
  1. function edytuj($id)
  2. {
  3.  
  4. polacz();
  5. include_once("../fckeditor/fckeditor.php");
  6.  
  7. $ta=mysql_query("SELECT * FROM newsy Where id='$id'") or die (" Błąd zapytania ".mysql_error());
  8. if(mysq_num_rows($ta)>0)
  9. {
  10. while($o=mysql_fetch_assoc($ta))
  11. {
  12.  
  13.  
  14.  
  15. $oFCKeditor = new FCKeditor('tresc') ;
  16. $oFCKeditor->BasePath = '../fckeditor/' ;
  17. $oFCKeditor->Value =''.$o['tresc'].'' ;
  18. $oFCKeditor->Width = '90%' ;
  19. $oFCKeditor->Height = '300' ;
  20. $oFCKeditor->Create() ;
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31. }
  32.  
  33.  
  34.  
  35. }
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




a sprawdziles chociaz, czy wogole jakies dane masz dla swojego zapytania?
  1. while($o=mysql_fetch_assoc($ta))
  2. {
  3.  
  4. echo 'Juhu, widzisz mnie? ';
  5.  
  6. $oFCKeditor = new FCKeditor('tresc') ;
  7. $oFCKeditor->BasePath = '../fckeditor/' ;
  8. $oFCKeditor->Value =''.$o['tresc'].'' ;
  9. $oFCKeditor->Width = '90%' ;
  10. $oFCKeditor->Height = '300' ;
  11. $oFCKeditor->Create() ;
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. }
Go to the top of the page
+Quote Post
istrd
post
Post #3





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 3.12.2009

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


tak spradzałem
echo wydaje sie być nie potrzebne ponieważ kod poniżej generuje całego FCKeditora i wyświetla go :


  1. include_once("../fckeditor/fckeditor.php");
  2. $oFCKeditor = new FCKeditor('tresc') ;
  3. $oFCKeditor->BasePath = '../fckeditor/' ;
  4. $oFCKeditor->Value = '<p> To jest przykladowa wiadomosc</p>' ;
  5. $oFCKeditor->Width = '90%' ;
  6. $oFCKeditor->Height = '300' ;
  7. $oFCKeditor->Create() ;
  8.  

Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
echo wydaje sie być nie potrzebne ponieważ kod poniżej generuje całego FCKeditora i wyświetla go :
wlasnie tym bardziej wydaje sie potrzebne, bo jak recznie wstawiasz to ci wyswietla, a jak wstawiasz generując z bazy to nie wstawia (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
istrd
post
Post #5





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 3.12.2009

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


dobra mam tak ale dalej nie wyświetla FCKeditora (IMG:style_emoticons/default/mad.gif)

  1. function edytuj($id)
  2. {
  3.  
  4. polacz();
  5. include_once("../fckeditor/fckeditor.php");
  6.  
  7. $ta=mysql_query("SELECT * FROM newsy Where id='$id'") or die (" Błąd zapytania ".mysql_error());
  8. if(mysq_num_rows($ta)>0)
  9. {
  10. while($o=mysql_fetch_assoc($ta))
  11. {
  12.  
  13.  
  14. echo"
  15. $oFCKeditor = new FCKeditor('tresc') ;
  16. $oFCKeditor->BasePath = '../fckeditor/' ;
  17. $oFCKeditor->Value ='".$o['tresc']."';
  18. $oFCKeditor->Width = '90%' ;
  19. $oFCKeditor->Height = '300' ;
  20. $oFCKeditor->Create() ;
  21.  
  22. ";
  23.  
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31. }
  32.  
  33.  
  34.  
  35. }
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




rety.... w echo miales dac BLABLABLA a nie kod php.... daj BLABLABLA i powiedz czy dostales te BLABLABLA
Go to the top of the page
+Quote Post
istrd
post
Post #7





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 3.12.2009

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


Cytat(nospor @ 26.01.2010, 22:52:56 ) *
rety.... w echo miales dac BLABLABLA a nie kod php.... daj BLABLABLA i powiedz czy dostales te BLABLABLA

dałem i nie dostałem tylko z jakiego powodu ?
  1. if($_GET['do']=="edytuj" && isset($_Get['id']))
  2. {
  3. $id=$_GET['id'];
  4.  
  5. edytuj($id);
  6.  
  7. }

to wywołanie tej funkcji oczywiście fragment (IMG:style_emoticons/default/smile.gif)

Ten post edytował istrd 26.01.2010, 23:00:17
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
dałem i nie dostałem tylko z jakiego powodu ?

Kurcze, to dlaczego gdy ci kazalem zrobic:
echo 'Juhu, widzisz mnie? ';
To napisales ze juz sprawdzales?

No to teraz zgadnij... moze dlatego ze nie masz rekordów dla zadanego zapytania. Jest to równie banalne do zdiagnozowania jak echo BLABLA wiec tym razem sprobuj wysilic sie samemu.
Go to the top of the page
+Quote Post

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: 22.08.2025 - 14:48