Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
weird..

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 05.03.2004 23:21    Post subject: weird.. Add user to your forum ignore list Reply with quote

ok, mozda je bzveze ali -
imam klasu za mysql i unutra funkciju koja mi vadi podatke sa mysql_fetch_array() .
radi sve super, samo imam 1 polje viska kada izvadi podatke-
imam 2 podatka , a ispis je ovako -
redni broj (1) podatak 1
erdnibroj (2) podatak 2
redni broj (3) [prazno]

zbog cega mi tako vadi..
kod je
Code:

function fetch() {
$this->result = mysql_fetch_array($this->query);
return $this->result;
}
[

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 08.03.2004 10:59    Post subject: Add user to your forum ignore list Reply with quote

Arrayi krecu od 0. Mozda tu grijesis? Kak ti izgleda kod kojim seces i ispisujes podatke u $this->result array-u?

A mozda stvarno dobijas jedan prazan record koji se nakako stvarno nasao u bazi?

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 08.03.2004 20:48    Post subject: Add user to your forum ignore list Reply with quote

Code:

/* nakon sto sam ubaio query u $DB->query("blabla"). onda stavljam
 */
while ($r = $DB->fetch() ) {

echo $r['polje_iz_tablice'];
}



ovako ide pseudo kod..
samo sto koristim smarty pa onda kad idem ispisivati onda ovako stavljam
Code:

   function news_statistics ()   {
      global $DB, $smarty;
      
      $DB->query("select news.news_id, news.news_title, cat.cat_name from nn_news news,   
                nn_categories cat where news.news_cat = cat.cat_id order by news.news_id desc
               ");
      //--------------------------------------
      // assign the array and the counter :D
      // for the smarty section output
      //--------------------------------------
      
      $out = array();
      $num = 0;
      
      while ($out[$num] = $DB->vadi())   {
         $num++;
      }
      
      
      $smarty->assign('layout', 'main');
      $smarty->assign('option', $out);
      $smarty->display('news.tpl');
      


ajde jos da i dodam kod za smarty output

Code:

<select name="kategorije">
         {section name=category loop=$category}
         <option value="{$category[category].cat_id}" label="{$category[category].cat_name}">{$category[category].cat_name}</option>
         {/section}
         </select>


_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 09.03.2004 09:41    Post subject: Add user to your forum ignore list Reply with quote

ako ti ovaj tvoj fetch() inace (u drugim fajlovima, modulima, projektima) radi kako treba, onda valjda nije greska u njemu samom, nego negdje drugdje...

Koliko se meni ovak cini (al nisam bas doma skroz sa smartyem) - u $out array potrpas sve, i to predajes smarty varjabli 'option'. A u ovom smarty kodu ne vidim nigdje taj option... Taj 'option' ti je ime bloka pretpostavljam?

Output koji dobijes od ovoga ti nije dobar? Ili od neceg drugog? Jer ovdje (smarty code) loopas kroz $category, koji ti je mozda negdje drugdje u kodu krivo dohvacen, pa ne dobijas prave rezultate za kategorije? Odnosno dobijes jednu praznu?

Rano mi je LeaveMeBe

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 09.03.2004 20:21    Post subject: Add user to your forum ignore list Reply with quote

fak krivi output kod za smarty sam stavio..
Code:

 {section name=nop loop=$option}
 <tr>
    <td>{$option[nop].news_id} </td>
    <td>{$option[nop].news_title}</td>
    <td>{$option[nop].cat_name}</td>
    <td><a href="?action=edit&id={$option[nop].news_id}">Edit</a></td>
    <td><a href="?action=delete&id={$option[nop].news_id}">Delete</a></td>
 </tr>
 {/section}


ovo je taj..

i probao sam staviti za ovaj brojac pocetnu vrijednost 1 , ali opet mi izbaci prazno polje, samo ovaj put mi je ono prvo po redu..

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 10.03.2004 09:38    Post subject: Add user to your forum ignore list Reply with quote

brojac mora bit na 0. to je ok.
i ovaj section je ok. sigurno nemas u bazi neki prazan njuz koji je uletio prilikom nekog testiranja? da probas u bazi direktno opalit taj query i pogledat koliko ti rezultata vraca?

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 10.03.2004 20:57    Post subject: Add user to your forum ignore list Reply with quote

a sa ispisom iz tablice je sve ok, nemam praznih polja..
ok.. budem ugnjavio one na smarty forumu..

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 11.03.2004 08:51    Post subject: Add user to your forum ignore list Reply with quote

print_r($out) ti vrati sto tocno?

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group