jonass Posted September 28, 2003 Report Share Posted September 28, 2003 es dzirdeeju ka par datubaazi var izmantot arii txt failus. kaads nevareetu pastaastiit ka iisti darbojas shii sisteema un varbuut paraadiit kaadu piemeeru. paldies. Link to comment Share on other sites More sharing options...
fassko Posted September 28, 2003 Report Share Posted September 28, 2003 ieraksta informaaciju iekss txt failinja veidojot tabulu liek atdalosso sombolo peec tam explode() un atlasa vajadziigo starp citu pameklee googlee un sheit arii bija taads topiks k-kad senaak ;) Link to comment Share on other sites More sharing options...
Benvenuto Posted September 29, 2003 Report Share Posted September 29, 2003 a kaa ar txt failiem var nodroshinaaties, lai lietotaajs netiek klaat tavai txt datubaazei? man tas neliekas eerti. gan jau ka ir kaads veids, bet tas vareetu buut chakars. ja kaads prasa man, iesaku lietot mysql. freesql.org ;) Link to comment Share on other sites More sharing options...
Roze Posted September 29, 2003 Report Share Posted September 29, 2003 Jakonfiguree apache un jaaizliedz .txt faili (vai arii lasiit direktoriju kuraa atrodas muusu txt db).. Ja ir atljauts izmantot .htacess failus vai ir pieeja konfigam (tas ir tavs pasha webserveris) tad easy ja nav (teiksim hosteejies pie kaada) tad var meegjinaat datus glabaat nevis .txt failos bet .php failos un saakumaa un beigaas iebakstiit <? un ?> Liidz ar to pie nolasiishanas buus jaaizmet faila pirmaa peedeejaa rinda tachu useris pa taisno failu apskatiit nevarees.. Protams visaadaa zinjaa tas ir krietni saregzjiitaak (zinaamos jautaajumos kaa atlasiishana,sorteeshana, ierakstu limiteeshana) nekaa straadaat ar kaadu no sql datubaazeem (mysql,pgsql u.c.) Link to comment Share on other sites More sharing options...
Qued Posted September 29, 2003 Report Share Posted September 29, 2003 Txt formāts no īstas datubāzes ir tikpat tāls kā cūkkūtiņa no kosmosa stacijas. Txt failā var tikai glabāt informāciju, visāda datu atlasīšana un meklēšana txt failā būs nejēdzīgi neērts pasākums. Bet darīt jau var. Ērti ir glabāt masīvus txt failā izmantojot funkcijas serialize() un unserialize(). Windows vidē gan laikam ar txt failiem var strādāt arī kā ar datu tabulām, ja darbojas caur odbc - iekš odbc var noformēt comma-delimited teksta failu kā datu avotu. Link to comment Share on other sites More sharing options...
Benvenuto Posted September 29, 2003 Report Share Posted September 29, 2003 kaukur dzirdeeju nelaagas baumas ka http://pods.lv griezhoties uz txt datubaazeem. ja taa ir taisniiba, tad jau itkaa lietojami tie txt ir, jo apmekleetaaju tur daudz, slodziite ir un ar uzdevumu jamaas tiek galaa. labi aizveros par sho teemu, neesmu nekad lietojis txt datubaazes. :D Link to comment Share on other sites More sharing options...
jonass Posted September 29, 2003 Author Report Share Posted September 29, 2003 hmm varbut kaads vareetu iemest kaadu koda piemerinju. savaadaak es biki veel neierubiijos. Link to comment Share on other sites More sharing options...
fassko Posted September 29, 2003 Report Share Posted September 29, 2003 www.hotscripts.com un ar shaadu passu jautaajumu vai liidziigu topiks viens jau bija :) Link to comment Share on other sites More sharing options...
jonass Posted September 29, 2003 Author Report Share Posted September 29, 2003 nju es atradu vienu ljoti vienkaarshu guestbooku, kuraa tiek ievietots txt fails, bat kad posteeju formu, vinjsh man nesaglabaa tajaa txt failaa. <code><font color="#000000"> <div class="normalText"> <form action="addbook.php" method="post"> Message <textarea name="message" cols="50" rows="7" class="textbox"></textarea> Name <input type="text" name="name" size="48" class="textbox"> <input type="submit" value=" Submit " class="textbox"> </form> </div> </font> </code> - postoshanas kods <code><font color="#000000"> <div class="guestbookTop"> <a href="postform.php">Write</a> to a guestbook </div> <font color="#0000CC"><?php $fileName </font><font color="#006600">= </font><font color="#0000CC">file </font><font color="#006600">(</font><font color="#CC0000">"guestbook.txt"</font><font color="#006600">); </font><font color="#0000CC">$rows </font><font color="#006600">= </font><font color="#0000CC">count </font><font color="#006600">(</font><font color="#0000CC">$fileName</font><font color="#006600">); if (</font><font color="#0000CC">$rows </font><font color="#006600">> </font><font color="#0000CC">10</font><font color="#006600">) { if (!isset (</font><font color="#0000CC">$row</font><font color="#006600">) ) { </font><font color="#0000CC">$row </font><font color="#006600">= </font><font color="#0000CC">0</font><font color="#006600">; } print (</font><font color="#CC0000">"<table class="</font><font color="#0000CC">guestbookLinks</font><font color="#CC0000">"><tr><td width="</font><font color="#0000CC">50</font><font color="#006600">%</font><font color="#CC0000">">"</font><font color="#006600">); if (</font><font color="#0000CC">$row </font><font color="#006600">> </font><font color="#0000CC">0</font><font color="#006600">) { echo </font><font color="#CC0000">"<div class="</font><font color="#0000CC">nextPage</font><font color="#CC0000">"><< <a href="</font><font color="#0000CC">readbook</font><font color="#006600">.</font><font color="#0000CC">php</font><font color="#006600">?</font><font color="#0000CC">row</font><font color="#006600">=</font><font color="#CC0000">" . ($row - 10) . "">Next 10</a></div>"</font><font color="#006600">; } print (</font><font color="#CC0000">"</td><td width="</font><font color="#0000CC">50</font><font color="#006600">%</font><font color="#CC0000">">"</font><font color="#006600">); if ( (</font><font color="#0000CC">$rows </font><font color="#006600">- </font><font color="#0000CC">$row</font><font color="#006600">) > </font><font color="#0000CC">10</font><font color="#006600">) { echo </font><font color="#CC0000">"<div class="</font><font color="#0000CC">previousPage</font><font color="#CC0000">"><a href="</font><font color="#0000CC">readbook</font><font color="#006600">.</font><font color="#0000CC">php</font><font color="#006600">?</font><font color="#0000CC">row</font><font color="#006600">=</font><font color="#CC0000">" . ($row + 10) . "">Previous 10</a> >></div>"</font><font color="#006600">; } print (</font><font color="#CC0000">"</td></tr></table>"</font><font color="#006600">); for (</font><font color="#0000CC">$i </font><font color="#006600">= </font><font color="#0000CC">$row</font><font color="#006600">; </font><font color="#0000CC">$i </font><font color="#006600">< (</font><font color="#0000CC">$row </font><font color="#006600">+ </font><font color="#0000CC">10</font><font color="#006600">); </font><font color="#0000CC">$i</font><font color="#006600">++) { echo </font><font color="#0000CC">$fileName </font><font color="#006600">[</font><font color="#0000CC">$i</font><font color="#006600">]; } } else { for (</font><font color="#0000CC">$i</font><font color="#006600">=</font><font color="#0000CC">0</font><font color="#006600">; </font><font color="#0000CC">$i </font><font color="#006600">< </font><font color="#0000CC">$rows</font><font color="#006600">; </font><font color="#0000CC">$i</font><font color="#006600">++) { echo </font><font color="#0000CC">$fileName </font><font color="#006600">[</font><font color="#0000CC">$i</font><font color="#006600">]; } } </font><font color="#0000CC">?> </font> <div class="guestbookUp"> <a href="postform.php">Write</a> to a guestbook </div></font> </code> - nolasiishanas kods mosh kaukas nepareizi Link to comment Share on other sites More sharing options...
jonass Posted September 29, 2003 Author Report Share Posted September 29, 2003 aa un veel addbook.php, kuram tiek posteec tas viss <code><font color="#000000"> <font color="#0000CC"><?php </font><font color="#006600">if (</font><font color="#0000CC">$message </font><font color="#006600">!= </font><font color="#CC0000">''</font><font color="#006600">) { </font><font color="#0000CC">$message </font><font color="#006600">= </font><font color="#0000CC">str_replace </font><font color="#006600">(</font><font color="#CC0000">"n"</font><font color="#006600">,</font><font color="#CC0000">" "</font><font color="#006600">,</font><font color="#0000CC">$message</font><font color="#006600">); </font><font color="#0000CC">$message </font><font color="#006600">= </font><font color="#0000CC">strip_tags </font><font color="#006600">(</font><font color="#0000CC">$message</font><font color="#006600">, </font><font color="#CC0000">' '</font><font color="#006600">); </font><font color="#0000CC">$newRow </font><font color="#006600">= </font><font color="#CC0000">'<div class="viewGuestbook">' </font><font color="#006600">. (</font><font color="#0000CC">$message</font><font color="#006600">) . </font><font color="#CC0000">' ' </font><font color="#006600">. </font><font color="#0000CC">[url=http://lv.php.net/date]date[/url]</font><font color="#006600">(</font><font color="#CC0000">'d.m.Y H:i'</font><font color="#006600">) . </font><font color="#CC0000">' - ' </font><font color="#006600">. </font><font color="#0000CC">strip_tags </font><font color="#006600">(</font><font color="#0000CC">$name</font><font color="#006600">) . </font><font color="#CC0000">'</div>'</font><font color="#006600">; </font><font color="#0000CC">$oldRows </font><font color="#006600">= </font><font color="#0000CC">join </font><font color="#006600">(</font><font color="#CC0000">''</font><font color="#006600">, </font><font color="#0000CC">file </font><font color="#006600">(</font><font color="#CC0000">'guestbook.txt'</font><font color="#006600">) ); </font><font color="#0000CC">$fileName </font><font color="#006600">= </font><font color="#0000CC">fopen </font><font color="#006600">(</font><font color="#CC0000">'guestbook.txt'</font><font color="#006600">, </font><font color="#CC0000">'w'</font><font color="#006600">); </font><font color="#0000CC">fputs </font><font color="#006600">(</font><font color="#0000CC">$fileName</font><font color="#006600">, </font><font color="#0000CC">$newRow </font><font color="#006600">. </font><font color="#0000CC">[url=http://lv.php.net/chr]chr[/url]</font><font color="#006600">(</font><font color="#0000CC">13</font><font color="#006600">) . </font><font color="#0000CC">[url=http://lv.php.net/chr]chr[/url]</font><font color="#006600">(</font><font color="#0000CC">10</font><font color="#006600">) . </font><font color="#0000CC">$oldRows</font><font color="#006600">); </font><font color="#0000CC">fclose </font><font color="#006600">(</font><font color="#0000CC">$fileName</font><font color="#006600">); } include (</font><font color="#CC0000">"readbook.php"</font><font color="#006600">); </font><font color="#0000CC">?></font> </font> </code> Link to comment Share on other sites More sharing options...
Roze Posted September 29, 2003 Report Share Posted September 29, 2003 Txt formāts no īstas datubāzes ir tikpat tāls kā cūkkūtiņa no kosmosa stacijas. Txt failā var tikai glabāt informāciju, visāda datu atlasīšana un meklēšana txt failā būs nejēdzīgi neērts pasākums. Bet darīt jau var.Ērti ir glabāt masīvus txt failā izmantojot funkcijas serialize() un unserialize(). Windows vidē gan laikam ar txt failiem var strādāt arī kā ar datu tabulām, ja darbojas caur odbc - iekš odbc var noformēt comma-delimited teksta failu kā datu avotu. Nee nu kapeec? ja tu vari uzrakstiit normaalu interfeisu funkcijas, sortinga atbalstu (aiz kam taadas lietas eksistee (ir uzkodeetas) kaa flat file databases) tad saliidzinaajums par cuukkuutinju ir nevietaa.. un pie maziem datu apjomiem cuukkuutinji liek iekshaa "kosmosa staciju" ka nemetas (var pamekleet googlee 'php text file databases' vai 'flat file databases').. p.s. jaa pods.lv vismaz kaadreiz (iespeejams ka veelarvien ja CLX nav ko mainiijis) griezhas uz .txt Link to comment Share on other sites More sharing options...
tamster Posted October 4, 2003 Report Share Posted October 4, 2003 Ir izstrādāti arī speciāli API... reku viens no tiem: TXT DB API Link to comment Share on other sites More sharing options...
AntiXakep Posted November 1, 2003 Report Share Posted November 1, 2003 Klau! Man tads jautajums !! Piem. es datus saglabaju txt failos sada veida Niks||||email@mails.lv||||www.adrese.lv||||site baigi liela zina|||||datums un laiks||||te vel sadi tadi dati Niks||||email@mails.lv||||www.adrese.lv||||site baigi liela zina|||||datums un laiks||||te vel sadi tadi dati Niks||||email@mails.lv||||www.adrese.lv||||site baigi liela zina|||||datums un laiks||||te vel sadi tadi dati Mana problema es gribetu piemeram uztaisit ta lai es varetu tos datus izmaimnit redigejot vai pievienojot jaunus vai ari vispar izdzesot!!!! Ko man darit? Mysql neiesakiet , ja ari iesakiet tad vismaz iepostejiet kadu piemeeru kur varetu dzest datus un mainit un pievienot klat! Pleazzzzzzzzzzzzzzz es esmu izmisumaaaaaa! Un ja kas to MySQL es vispar nerubiju !!!!!! Link to comment Share on other sites More sharing options...
jannis Posted November 1, 2003 Report Share Posted November 1, 2003 http://www.cs.lpu.lv/php/index.php?id=aug Link to comment Share on other sites More sharing options...
Recommended Posts