Jump to content
php.lv forumi

FT3

Reģistrētie lietotāji
  • Posts

    183
  • Joined

  • Last visited

Posts posted by FT3

  1. itka ta ?

    <form method="post" action="?go=search">
       <input type="text" name="search" />
       <input type="submit" name="search" value="OK" />
    </form>

     

    tavs kods !

    <?php
    
    $searcharray=explode(" ",substr($_GET['search'],0,50));
    foreach($searcharray as $word){
        $searchstring.="+".$word."* ";
    }
    $searchstring=check_input($searchstring);
    $q=sprintf("SELECT * FROM movie
               WHERE MATCH (title) AGAINST (%s IN BOOLEAN MODE)",
               $searchstring);
    $result=mysql_query($q);
    
    
    ?>

     

     

    met erroru

    Fatal error: Call to undefined function check_input() in C:\AppServ\www\modules\search.php on line 7

  2. un ka lai ar input ? :D jo es nesaprotu neko no funkcijam :D

     

    un uz 7linijas erros

     

    Fatal error: Call to undefined function check_input() in C:\AppServ\www\modules\search.php on line 7

  3. hmm uzrada šo ;/

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to = '1' ORDER by id LIMIT 1' at line 1

     

    palidziet vel šo plizzz , vairs jautajumu nebus ;/

  4. Kļuda

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\includes\message.php on line 4

     

    kods

    <?php
    $result = mysql_query("SELECT * FROM messages WHERE to = '{$_SESSION['wID']}' ORDER by id LIMIT 1");
    
    while($row = mysql_fetch_array($result))
     {
     echo $row['from'] . " " . $row['text'];
     echo "<br />";
     }
    ?>

  5. vel viens jautajums !

     

    Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\includes\message.php on line 2

     

    $result = mysql_query("SELECT * FROM messages WHERE to = '"$_SESSION['wID']"' ORDER by id LIMIT 1");

  6. vai kads varetu man pateiks kas ši ir pa kļudu ?

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, text) VALUES ('1', '1', 'aaaa')' at line 1

     

     

    kods ir tads !

    <?function add(){ ?>
    
    <form action="" method="POST" >
    
    <textarea  class="commFl" rows="8" cols="30" name="text"></textarea>
    <input type="submit" name="aiziet" value="Pievienot!">
    
    </form>
    <?}
    
    if ($_POST['aiziet']) { 
    
    $id = $_GET['id'];
    $from = $_SESSION['wID'];
    $text = $_POST['text'];
    
    if (($text != "")) { ?>
    
    <b>Done!</b>
    <?
    mysql_query("INSERT INTO message (id, from, text) VALUES ('$id', '$from', '$text') ") or die(mysql_error());
    }}else{add();}
    ?>

  7. te tada lieta

     

    ka lai ustajsa lai orderjeas

     

    nevis pec mazaka bet pec lielaka skaitla ?

     

    $query  = "SELECT * FROM movie ORDER BY views LIMIT 1";

  8. <H2>Список Фильмов</h2>
    
    <div id=hcontent>
    <table width=100%>
    <?php
    include 'includes/connect.php';
    
    if(!isset($_GET['page'])){
       $page = 1;
    } else {
       $page = (int)$_GET['page'];
    }
    $max_results = 1;
    $from = (($page * $max_results) - $max_results);
    
    if(isset($_GET['cat'])){
      $sql=mysql_query("SELECT * FROM movie WHERE category = '".(int)$_GET['cat']."' ORDER by id LIMIT $from, $max_results");
    }else{
      $sql=mysql_query("SELECT * FROM movie ORDER BY id LIMIT $from, $max_results");
    }
    
    while($row = mysql_fetch_array($sql)){
       // Nak visa draza ara tiesi seit.
     echo "<tr><td><img src='../style/icons/";
     echo $row['category'];
     echo ".gif'></td>";
     echo "<td>";
     echo $row['title'];
     echo "</td>";
     echo "<td><a href='?go=view-movie&id=";
     echo $row['id'];
     echo "'>Просмотор</a></td></tr>";
    }
    
    if(isset($_GET['cat'])){
      $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM movie WHERE category = '".(int)$_GET['cat']."'"),0);
    }else{
      $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM movie"),0);
    }
    
    
    $total_pages = ceil($total_results / $max_results);
    
    
    echo "<table><tr>";
    
    if(isset($_GET['cat'])){
    
    for($i = 1; $i <= $total_pages; $i++){
       if(($page) == $i){
           echo "<td><span class='page_numbers'>$i</span></td>";
           } else {
               echo "<td><a class='page_numbers' href=\"".$_SERVER['PHP_SELF']."?go=movie&cat=".(int)$_GET['cat']."&page=$i\">$i</a></td>";
       }
    }
    
    }else{
    
    
    for($i = 1; $i <= $total_pages; $i++){
       if(($page) == $i){
           echo "<td><span class='page_numbers'>$i</span></td>";
           } else {
               echo "<td><a class='page_numbers' href=\"".$_SERVER['PHP_SELF']."?go=movie&page=$i\">$i</a></td>";
       }
    }
    
    }
    
    echo "</tr></table>";
    ?>
    </table>
    </div>

     

    links irs šads

    ?go=movie&page=2

    bet ja uzliek

    ?go=movie&page=a vai ?go=movie&page=56456754

    uzrada eroru

     

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\modules\movie.php on line 22

     

    ka lai to izlabot , piem "tada lapa neeksiste !" erora vieta ;)

  9. Kads nevaretu pievienot sadalisanas pa lapam scriptu

     

    Mans Kods

    <?php
    require("includes/connect.php");
    
    if(isset($_GET['cat'])){
      $result=mysql_query("SELECT * FROM movie WHERE category = '".(int)$_GET['cat']."' ORDER by id");
    }else{
      $result=mysql_query("SELECT * FROM movie ORDER BY id");
    }
    
    while($row = mysql_fetch_array($result))
     {
     echo "<tr><td><img src='../style/icons/";
     echo $row['category'];
     echo ".gif'></td>";
     echo "<td>";
     echo $row['title'];
     echo "</td>";
     echo "<td><a href='?go=view-movie&id=";
     echo $row['id'];
     echo "'>Просмотор</a></td></tr>";
     }
    
    ?> 

     

    mekleju google neko ipašu neesmu atradis ;/

×
×
  • Create New...