Jump to content
Forumul va fi temporar pus pe modul mentenanta intre orele 20:00 - 22:00 pentru niste teste ×

Timp rămas până la Black Week

Pentru detalii complete despre promoție click aici

Black Week a început!

Pentru detalii complete despre promoție click aici

Search the Community

Showing results for tags 'programming'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • B-Zone
    • Announcements
    • B-Zone Clips
    • Community
    • Forum Suggestions
    • Market
    • Questions and Answers
  • San Andreas Multiplayer
    • RPG.B-Zone.Ro:7777 Roleplay
    • Wiki Website
  • Rage Multiplayer
    • V.B-ZONE.RO
  • B-Zone Online
    • B-Zone Championships
    • B-Zone Clans & Clubs
    • B-Zone Radios
    • Counter-Strike 1.6
    • Discord
    • Metin2
    • Minecraft
  • IT Zone
    • Design
    • Gadgets
    • Programming
    • Software & Hardware
    • Video Games
  • Real life
    • Entertainment
    • History
    • Juridic
    • Lifestyle
    • Politics
    • Sport
    • Vehicles
  • Trash Can
    • Trash Can
  • The Last Generation [TLG]'s The Last Generation
  • Very Important Person [VIP]'s [VIP] - Topic
  • zero Limits [zL]'s Topics
  • Sons of Anarchy MC [SoA]'s Club Matters
  • Unheard Spirits [END]'s Topics
  • The First Generation [TFG]'s General
  • United Blood Nation [UBN]'s DSICUTII LIBERE MEMBRII!
  • Wild Balkans [WB]'s Informatii
  • True Silent Aimbot [TSA]'s Topics
  • Alliance [A]'s General
  • Merry Weather [MW]'s Prezenta activitati
  • Merry Weather [MW]'s Anunturi Importante
  • Merry Weather [MW]'s Giveaway
  • Merry Weather [MW]'s Giveaway
  • Dangerous Life [dL]'s General
  • Elite Squad [eS]'s Discord
  • Fallen Angels [F]'s Topicurile Clanului # Clan Topics
  • Fallen Angels [F]'s Fallen Angels [F] # Regulament / Rules
  • Fallen Angels [F]'s Fallen Angels [F] # Sistem Promovare / Rank-UP
  • GTT Racing [GTT]'s GTT Racing
  • Hunters [H]'s Regulament
  • The Royal Family [RF]'s The Royal Family [RF]
  • Royal Shadows [RS]'s Rank up % Salarii

Calendars

  • Community Calendar
  • Merry Weather [MW]'s Events

Product Groups

There are no results to display.

Categories

  • MODURI
    • CLEO/SAMPFUNCS
    • Vehicles
    • Skins
    • Sounds
    • Effects
    • Weapons
    • Others
    • Modpacks
  • True Silent Aimbot [TSA]'s Files
  • Merry Weather [MW]'s Event

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Steam ID


Discord


Instagram


Location


Hobbies


Real name


RPG Nickname

Found 1 result

  1. Salutare prieteni, am revenit cu o continuare la primul tutorial in care aratam cum sa conectam baza de date in PHP si sa afisam date in pagina. Astazi o sa va arat cum sa adaugam functia de search care afiseaza rezultate in aceeasi pagina PHP. Pentru a putea intelege corect tot tutorialul de astazi, va rog sa aruncati o geana peste acest tutorial: Adaugarea functiei search si afisarea datelor in aceeasi pagina. Dupa ce baza de date este conectata iar pagina index.php afiseaza datele din baza de date adaugam in mai sus de codul PHP un cod HTML care arata cam asa: <form action="index.php" method="post"> <input type="text" name="search" /> <input type="submit" value="Search" /></form> Ce face acest cod mai exact, face un textbox in care noi putem sa adaugam niste valori iar cand apasam butonul, el prin metoda post ne paseaza valorile catre functia %searchq% pe care o sa o definim si o folosim mai departe in codul MySQL. Pagina initiala trebuie sa arate cam asa, inainte de adaugarea codului HTML pentru search: De la acest cod de baza(Codul este explicat parca in celalalt tutorial) care doar afiseaza niste date in pagina incepem sa lucram mai departe pentru functia search: <?php require_once "config.php"; ?> <form action="index.php" method="post"> <input type="text" name="search" /> <input type="submit" value="Search" /></form> <section id="content"> <?php $q = mysqli_query($link, "SELECT * FROM comments Order by `id` desc LIMIT 5600"); while($row = mysqli_fetch_array($q)) { ?> <h5>User: <?= $row["nume"]; ?> <small> Ora: <?= $row["ora"]; ?></small></h5> <?= $row["text"]; ?> <p> <br> </p> <?php } ?> </section> Dupa adaugarea codului, pagina trebuie sa arate cam asa: Primul pas este deja facut, am adaugat codul HTML care ne paseaza valorile, urmeaza sa facem o conditie(IF), care spune asa: Daca functia search nu este atinsa, afiseaza toate datele, daca functia search este atinsa, afiseaza doar datele care sunt asemanatoare cu valorile din %searchq%. Tot ce trebuie sa facem este sa copiem partea de cod care deja ne afiseaza datele in MySQL si sa o adaptam conditiei conform cerintelor noastre. <?php require_once "config.php"; ?> <form action="index.php" method="post"> <input type="text" name="search" /> <input type="submit" value="Search" /></form> <section id="content"> <?php if(isset($_POST['search'])) { $searchq = $_POST['search']; $q = mysqli_query($link, "SELECT * FROM comments WHERE `nume` LIKE '%$searchq%' OR `text` LIKE '%$searchq%' OR `ora` LIKE '%$searchq%' Order by `id` desc"); while($row = mysqli_fetch_array($q)) { ?> <h5>User: <?= $row["nume"]; ?> <small> Ora: <?= $row["ora"]; ?></small></h5> <?= $row["text"]; ?> <p> <br> </p> <?php } } else { $q = mysqli_query($link, "SELECT * FROM comments Order by `id` desc LIMIT 5600"); while($row = mysqli_fetch_array($q)) { ?> <h5>User: <?= $row["nume"]; ?> <small> Ora: <?= $row["ora"]; ?></small></h5> <?= $row["text"]; ?> <p> <br> </p> <?php } } ?> </section> Dupa adaugarea conditiei, cam asa trebuie sa functioneze codul: Si practic cam asta este toata vrajeala, totul tine de o conditie care afiseaza doar datele relevante cautarii noastre. Daca aveti intrebari, astept PM pe forum, comentarii sau mesaje pe discord: GhOsT_x#6329 sau b-zone.ro/discord.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.