djmartins Posted November 18, 2005 Report Share Posted November 18, 2005 Taa tad man ir lapa kur es veidoju kategorijas un kuras saglabas db.Un pie zinu pievienosanas man vajadzetu tur kur butu jaradas kategorijam lai raditos tas kuras atrodas man taja konkretaja db!Manuali visulaiku likt klaat domaju nav ipasi jautri!Kaa butu apmeram jaizskatas?Ja db kur glabasies tas kategorijas sauksies cat! Kategorija: <select name="cat"> <option value="Informacija">Informacija</option> <option value="Dators">Dators</option></select> Link to comment Share on other sites More sharing options...
bubu Posted November 18, 2005 Report Share Posted November 18, 2005 (edited) Kā lai mēs zinam kā ir jāizskatās, ja neviens nezin ne tavu db stuktūru, ne īsti ko tev vajag tur.. Edited November 18, 2005 by bubu Link to comment Share on other sites More sharing options...
Klez Posted November 18, 2005 Report Share Posted November 18, 2005 CREATE TABLE cat (id INT (3) DEFAULT '0' AUTO_INCREMENT, cat VARCHAR (255) DEFAULT '0', PRIMARY KEY(id)) ja tu domaaji tabulas struktuuru Link to comment Share on other sites More sharing options...
php_Stopp Posted November 18, 2005 Report Share Posted November 18, 2005 .. tu domā no db selectot table-us ? Link to comment Share on other sites More sharing options...
ohmygod Posted November 18, 2005 Report Share Posted November 18, 2005 (edited) Es domāju ka domāts - kā dabūt iekš selecta optionus ar kategorijām... tjip $r=mysql_query("SELECT cat_name FROM categories ") or die(mysql_error()); while($row=mysql_fetch_array($r)){ echo'<option value="'.$row['cat_name'].'">'.$row['cat_name'].'</option>'; } Edited November 18, 2005 by ohmygod Link to comment Share on other sites More sharing options...
djmartins Posted November 19, 2005 Author Report Share Posted November 19, 2005 Nu kaut ka sita vajadzetu but bet te kaut kas neiet!Kaut kas ne taa?Lieta taada ka vins izvada katru kategoriju savaa select bet vajadzetu taa ka visas kategorijas vienaa tajaa fignaa iisti nezinu kaa vina saucas! $r=mysql_query("SELECT cat FROM category ") or die(mysql_error()); while($res=mysql_fetch_array($r)){ echo("<select name=cat>"); echo("<option value=$res[cat]>$res[cat]</option>"); } Doma ceru ka tagad ir skaidra! Link to comment Share on other sites More sharing options...
bubu Posted November 19, 2005 Report Share Posted November 19, 2005 Ja tu skaidrāk izskaidrotu, kas tev nesanāk, tad tev varbūt arī kāds spētu palīdzēt. A savādāk nekā nesaprotu... Link to comment Share on other sites More sharing options...
teror Posted November 20, 2005 Report Share Posted November 20, 2005 select tags jāatver pirms loopa echo '<select name=cat>'; $r=mysql_query("SELECT cat FROM category ") or die(mysql_error()); while($res=mysql_fetch_array($r)){ echo '<option value='.$res[cat].'>'.$res[cat].'</option>'; } echo '</select>'; Link to comment Share on other sites More sharing options...
Recommended Posts