sviesc Posted December 9, 2003 Report Share Posted December 9, 2003 man te tāds koda gabaliņš es baigi vēlētos lai man širo pēc sadalam un piemēram izdrukā tikai noteiktas sadaļas saturu <? //te saksies to datu izvade kas ir datu bazee if (!$visi) { echo( mysql_error()); } else { while ($row = mysql_fetch_array($visi)) { $vards = $row["name"]; $post = $row["post"]; $izvele = $row["sadala"]; $dat = $row["datums"]; ?> <tr> <td width="25%"><b><font face="Verdana" size="2" color="#000080"><? echo $name; ?></font></b></td> <td width="25%"><b><font face="Verdana" size="2" color="#000080"><? echo $post; ?></font></b></td> <td width="25%"><b><font face="Verdana" size="2" color="#000080"><? echo $izvele; ?></font></b></td> <td width="25%"><b><font face="Verdana" size="2" color="#000080"><? echo $dat; ?></font></b></td> </tr> :blink: Link to comment Share on other sites More sharing options...
des Posted December 9, 2003 Report Share Posted December 9, 2003 jau pashaa querijaa taisi select........ where sadala='vajadziigaa_sadalja' tad arii izdrukaas tikai attieciigo sadalju... Link to comment Share on other sites More sharing options...
Benvenuto Posted December 9, 2003 Report Share Posted December 9, 2003 papeeti: http://www.w3schools.com/sql/sql_where.asp kaa arii visu paareejo w3schools saitu - labs. Link to comment Share on other sites More sharing options...
sviesc Posted December 9, 2003 Author Report Share Posted December 9, 2003 Ok tiktālu labi, Bet man tagad nākošā problēma šitam koda gabalam tākā nevajadzētu automātiski ieraxtīt datubāze tukšus lauks izņemot datumu uz refreš <? $datums=date("d.m.Y H:i:s"); //nodefinejam datumu $hostname = "localhost"; //nodefine serveri $username = "bla";//nodefine lietotaju $password = "blabla";//nodefine paroli $dbName = "blala"; //nodefine datu bazi $usertable = "kuku"; //nodefine datubazi MYSQL_CONNECT ($hostname,$username,$password) OR DIE ("nav servera"); mysql_select_db("$dbName") or DIE ("Nav DB."); $visi = mysql_query("SELECT * FROM $usertable ORDER BY `id` DESC "); $abols = mysql_query("SELECT * FROM $usertable WHERE auglji='Aboli'"); $skaits = MYSQL_NUMROWS($visi); ?> <? if (!$visi) { echo( mysql_error()); } else { while ($row = mysql_fetch_array($visi)) { $vards = $row["name"]; $epasts = $row["post"]; $izvele = $row["sadala"]; $dat = $row["datums"]; ?> es tākā nesaprast kapē viņš man uz refreš iemet vel kādu ieraxtu db :blink: Link to comment Share on other sites More sharing options...
des Posted December 9, 2003 Report Share Posted December 9, 2003 Shim koda gabalam vispaar neko ieksh db mest nevajadzeetu, jo tur tachu nav neviena INSERT!!! Link to comment Share on other sites More sharing options...
sviesc Posted December 9, 2003 Author Report Share Posted December 9, 2003 Nu ja bet tur katkāds gļux laikam būs vis jāraxta no jauna :blink: Link to comment Share on other sites More sharing options...
des Posted December 9, 2003 Report Share Posted December 9, 2003 A Tev nav koda gabala, kur dara to INSERT? No tuksha gaisa DB jauni ieraxti tieshaam nevar uzrasties... Tev tachu ir kaut kaada forma, ar kuru Tu pievieno jaunus ieraxtus? vai kaa? Link to comment Share on other sites More sharing options...
sviesc Posted December 9, 2003 Author Report Share Posted December 9, 2003 protams lasi tehttp://paste.php.lv/579 :blink: Link to comment Share on other sites More sharing options...
des Posted December 9, 2003 Report Share Posted December 9, 2003 tur atkal nav neviena mysql_query('INSERT.....'); vai nevari iepastot arii to send.php (formas action) ..... vienkaarshi es nesaprotu, kaa var tikt pievienoti db ieraxti, ja vispaar nav neviena INSERT, bet ir tikai SELECT vairaaki.... :huh: Link to comment Share on other sites More sharing options...
sviesc Posted December 10, 2003 Author Report Share Posted December 10, 2003 (edited) Nu lūk te būt tas īstais koda gabals sorry neto iemetu :blink: http://paste.php.lv/581 :blink: Edited December 10, 2003 by sviesc Link to comment Share on other sites More sharing options...
des Posted December 10, 2003 Report Share Posted December 10, 2003 Pameegjini aizvietot: // ievietojam datus datu baazee $data = mysql_query("INSERT INTO $usertable (vards, epasts, auglji, datums ) VALUES ('$vards', '$text', '$sadala', '$datums')"); ar // ja posts ir noticis ievietojam datus datu baazee if (sizeof($_POST)>0){ $data = mysql_query("INSERT INTO $usertable (vards, epasts, auglji, datums ) VALUES ('$vards', '$text', '$sadala', '$datums')"); //forseejam refresh bez posta echo " <script> window.location='send.php'; </script> "; } Link to comment Share on other sites More sharing options...
sviesc Posted December 10, 2003 Author Report Share Posted December 10, 2003 jep nu tagad vis notiek vari uzmest aci rezūltātam...sviesc.valsts.lv :blink: P.S. pārbaudi emailu... Link to comment Share on other sites More sharing options...
Recommended Posts