ziedinjsh Posted April 5, 2010 Report Share Posted April 5, 2010 Pilnīgi nav ne jausmas, bet nu kā izveidot meklēšanas sistēmu, piem. man vajadzētu meklēt lietotājus.. vienīgais ko es zinu ar ko sākt ir šis :D <form method='post' action='search.php'> <input type='text' name='user'><input type='submit' name='user' value='Search'> </form> kādam būtu jāizskatās search.php nav ne jausmas. Ceru uz palīdzību, paldies jau iepriekš :) Quote Link to comment Share on other sites More sharing options...
waplet Posted April 5, 2010 Report Share Posted April 5, 2010 haahaa :D a kada tev datubaaze,, mja te pat zirgam jasmejas.. Btw tu tiesham domaa to panakt gatavu? vnk izlasi userneimu peec POST datiem. Quote Link to comment Share on other sites More sharing options...
briedis Posted April 5, 2010 Report Share Posted April 5, 2010 SELECT * FROM useri WHERE kolonna = kautkas vai WHERE kolonna like '%veertiiba%' ... Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted April 5, 2010 Author Report Share Posted April 5, 2010 kā tu to domāji, kāda datubāze? Quote Link to comment Share on other sites More sharing options...
briedis Posted April 5, 2010 Report Share Posted April 5, 2010 kā tu to domāji, kāda datubāze? Nu kā mēs varam palīdzēt, ja tev pašam nav ne jausmas, ko tu gribi, un kāda DB struktūra tev tur ir :D Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted April 6, 2010 Author Report Share Posted April 6, 2010 (edited) ja sapratu pareizi tad nu man ir tā: Tabula users, zem kuras ir - user_id, username, password, email, location, genre, avatar un date. un gribu lai search formā ierakstot vismaz 3 simbolus vai vairāk viņš atrod username kurā ir šie simboli. Piemēram, es ierakstu: edin un viņš man atrod ziedinjsh un tml. :) Edited April 6, 2010 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Pentiums Posted April 6, 2010 Report Share Posted April 6, 2010 $sql = mysql_query("SELECT * FROM users WHERE username LIKE '%".mysql_real_escape_string($_POST['user'])."%'"); while($data = mysql_fetch_array($sql)) { echo $data['username'].' '; } Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted April 6, 2010 Author Report Share Posted April 6, 2010 (edited) Tātad, tagad man ir šādi: form: echo "<form method='post' action='search.php'>"; echo "<input type='text' name='username'><input type='submit' name='username' value='Search'>"; echo "</form>"; search.php if(isset($_POST['username'])){ $sql = mysql_query("SELECT * FROM users WHERE username LIKE '%".mysql_real_escape_string($_POST['username'])."%'"); while($row = mysql_fetch_array($sql)) { echo $row['username'].' '; } Ko es esmu palaidis garām, vai netā izdarījis, jo uzspiežot search atveras search.php tukš? Edited April 6, 2010 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Pentiums Posted April 6, 2010 Report Share Posted April 6, 2010 (edited) input pogai name atribūta vērtību nomaini uz ko citu lai nav vienāda ar input text name vērtību Edited April 6, 2010 by Pentiums Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted April 6, 2010 Author Report Share Posted April 6, 2010 o, strādā, paldies! :) Vēlviens jautājums.. ja uzploadam ir abas name vertibas vienādas, tas nekas? Quote Link to comment Share on other sites More sharing options...
Pentiums Posted April 6, 2010 Report Share Posted April 6, 2010 tu domā šādi <input type="file" name="vertiba" name="vertiba" /> ? :D:D vai atkal kā iepriekšējajā gadijumā? :P Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 6, 2010 Report Share Posted April 6, 2010 name="vertiba[]" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.