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
problem php

 
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 -> Client-side
View previous topic :: View next topic  
Author Message
mladen



Joined: 07 Jan 2004
Posts: 43
Location: Dubrovnik

PostPosted: 31.01.2004 13:38    Post subject: problem php Add user to your forum ignore list Reply with quote

Htio bi da iz baze odredjeni query izvucem u selectList obliku

sve sto nadje za odredjeni upit da slaze u <select>

problem mi je kod slaganja html-a tocno neznam kako bi islo.

znaci recimo :

spojio se na bazu ...
-------------------------
$query = "SELECT namef from korisnici";
$result = pg_exec($db, $query);
if (!$result) {printf ("ERROR nema podataka u bazi, ili ih nemogu povuci"); exit
;}
$numrows = pg_numrows($result);
$row=0;
printf ("<table border=1>\n");
printf ("<select name="selectList" class="form">\n");
do
{
$myrow = pg_fetch_row ($result, $row);
printf ("<option value="$myrow[0]"></option>\n");
$row++;
}
while ($row < $numrows);
printf ("</table>\n");

-----------------

znam da sam uhebao html kod 99% samo nisam siguran sta Smile
jeli mi moze iko pomoci!

Hvala

_________________
"Revenge is best served cold" Smile

www.holobit.net - linux freaks
http://balegari.bxteam.org - Clan pages
Back to top
View user's profile Send private message Visit poster's website
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 31.01.2004 13:54    Post subject: Add user to your forum ignore list Reply with quote

Code:

function dropdown()
{
   $query = mysql_query("SELECT * FROM p4g_newscategories ORDER BY id DESC");
      if(!$query) {
         echo mysql_error();
         die();
      }
      
      $input = "<select name = 'game' id = 'game' class = 'input'>
                <option value = '0' selected>No category</option>";
      $priljepi = "";
      while($sql = mysql_fetch_array($query))
      {
         $priljepi.= "<option value = ".$sql['id'].">".$sql['name']."</option>";
         
      }
      $input.=$priljepi;
      $input.="</select>";
      return $input;
}


kopipejst iz nekog starog koda...
inace, $sql['id'] je ime autoinkrement retka, a sql['name'] je ono kaj se pojavi u dropdownu. sad, trebo bi iz ovog barem shvatit kak to radi..
ja imam funkciju te ako oces preko funkcije (ove) radit, onda je moras "execat" sa
Code:
echo dropdown();
Back to top
View user's profile Send private message
mladen



Joined: 07 Jan 2004
Posts: 43
Location: Dubrovnik

PostPosted: 31.01.2004 13:58    Post subject: Add user to your forum ignore list Reply with quote

tocno sto mi je trebalo .. baza je PGSQL .. ali same thing Smile

Hvala puno !!!!!

_________________
"Revenge is best served cold" Smile

www.holobit.net - linux freaks
http://balegari.bxteam.org - Clan pages
Back to top
View user's profile Send private message Visit poster's website
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 -> Client-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