Results 1 to 13 of 13

Thread: PHP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202

    PHP

    !
    !!
    ! , potrebiteli. 5 - id,ime,familia,potr_ime

    : , !
    :
    ,:
    id ime familia potr_ime
    1 nasko penchev edinak

    , :
    select * from potrebiteli where ime like "nasko";

    ! PHP. , ! :



    Code:
    <!doctype html public "-//W3C//DTD HTML 4.0 //EN">
    <html>
    <head>
    <title>..::Results::..</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>
    <body>
    <h1>eMagi results</h1>
    <?php
    $searchtype = $_POST['searchtype'];
    $searchterm = $_POST['searchterm'];
    if (!$searchtype || !$searchterm)
    {
    echo '   !';
    }
    $searchtype = addslashes($searchtype);
    $searchterm = addslashes($searchterm);
    @ $db = mysql_pconnect('localhost', 'root', 'test');
    if (!$db)
    {
    echo '       . - !';
    exit;
    }
    mysql_select_db('potrebiteli');
    $query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'";
    $result = mysql_query($query);
    $num_results = mysql_num_rows($result);
    echo '<p>The Result of Your searching: '.$num_results.'</p>';
    for ($i=0;$i < $num_results; $i++)
    {
    $row = mysql_fetch_array($result);
    echo '<p><strong>'.($i+1).'.: ';
    echo htmlspecialchars (stripslashes ($row['id']));
    echo '</strong><br />: ';
    echo stripslashes($row['ime']);
    echo '<br />: ';
    echo stripslashes($row['familia']);
    echo '<br /> : ';
    echo stripslashes($row['potr_ime']);
    echo'</p>';
    }
    ?>
    </body>
    </html>
    !
    :
    The Result of Your searching:
    P.S.
    :
    Code:
    $result = mysql_query($query);
    mysql_query($sql) or die(mysql_error());
    .
    .

    :


    eMagi results
    Query was empty

    A, ! mysql-a!
    ! !
    Last edited by emagi; 27th September 2007 at 11:10.

  2. #2
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . -> ... or die(mysql_error()); , !

    -> LIKE "%$words[$i]%"

    Code:
    $words = explode('&nbsp;',$searchterm);
    .. $_REQUEST $_POST, . globals.

    Code:
    $query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'";
    ??? $searchtype?

  3. #3
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833


    echo $query.'</ br>';

    , .
    $searchtype $searchterm ? .
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  4. #4
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Code:
    $query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'";
    . " " " " ??

    ( potrebiteli) ?

    :

    $query = mysql_query("SELECT * FROM potrebiteli WHERE potrebiteli LIKE '%$words[$i]%' AND = '$searchterm'");
    .. DISTINCT.

    edit: . . .
    Last edited by z0ne; 26th September 2007 at 19:08.

  5. #5
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202
    ! , po [b]id[/] 6! , , Petrov!
    Code:
    +----------+------------+------------+------------------------------------+
    | id | ime    |    familia     | potr_ime    |                   parola                         |
    +----+-----+------------+------------+-------------------------------------+
    |  1 | Svetla | Panajotowa|    Svetle    | *23AE809DDACAF96AF0FD78ED04B6A |
    |  2 | Pavel  | Petrov       |   emagi      | *23AE809DDACAF96AF0FD78ED04B6A |
    |  3 | Kiril     | Wylev       |     kiro       | *899ECD04E40F745BD52A4C552BE4A  |
    |  4 | Nadja  | Stoqnova    |     asi      | *FA12F1BDB7E27C0CA4F15E492CF70   |
    |  5 | Nasko  | Gerchev    |     agpol     | *007D50CA06F69776D307B1BEC71CD  |
    +----+------+------------+-----------+-------------------------------------+
    , :
    Query was empty
    mysql!
    Last edited by emagi; 27th September 2007 at 11:44.

  6. #6
    Dark tranquillity
    Join Date: Aug:2006
    Location: Sofia
    Posts: 796
    - :
    1. php- . ? .
    2. phpmyadmin .
    3. php, , , . " ..... 24 " " ..... " . . Mastering PHP Sybex PHP and mySQL Web Development. , .
    4. . echo, var_dump print_r. , , , , . echo $query , mysql query-to phpmyadmin-. . .

    . , , , .
    Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF

  7. #7
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202
    Quote Originally Posted by metalhead117 View Post
    - :
    1. php- . ? .
    2. phpmyadmin .
    3. php, , , . " ..... 24 " " ..... " . . Mastering PHP Sybex PHP and mySQL Web Development. , .
    4. . echo, var_dump print_r. , , , , . echo $query , mysql query-to phpmyadmin-. . .

    . , , , .
    , -!
    , , ! !
    , , , !
    :
    Code:
    $query = "select * from books where ".$searchtype." like '%".$searchterm."%'";
    " - !
    , , ! ,!
    , !
    , !
    !!!\
    P.S.
    , , !

  8. #8
    Dark tranquillity
    Join Date: Aug:2006
    Location: Sofia
    Posts: 796
    , . . , .

    , , . .

    : php.ini :
    display_errors = on
    off. off . , php 2-3 , .

    - , , , . - php ,
    Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF

  9. #9
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202
    " " - , ! :
    Code:
     Print out errors (as a part of the output).  For production web sites,
    ; you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below).  Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = On
    , , ! , , . , ! () RMIT ,! PHP MySQL, 3 !
    , !!!
    Last edited by emagi; 27th September 2007 at 12:56.

  10. #10
    Dark tranquillity
    Join Date: Aug:2006
    Location: Sofia
    Posts: 796
    ,

    , ";" ,
    -:

    display_errors = Off ( ; )

    On, . , web server- ( Apache) . php ", 34" , ,
    Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF

  11. #11
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202
    , ! , -, , , - html POST php HTML , ,
    Code:
    $self = $_SERVER['PHP_SELF'];
    :
    Code:
    form action=\"$self\";
    , - ! ???

  12. #12
    Dark tranquillity
    Join Date: Aug:2006
    Location: Sofia
    Posts: 796
    - . /
    Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF

  13. #13
    Registered User emagi's Avatar
    Join Date: Feb:2007
    Location: bulgaria
    Posts: 202
    10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |