Results 1 to 6 of 6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Paladin tank in the field Dare_Devil's Avatar
    Join Date: Jan:2005
    Location:
    Posts: 939

    PHP MySQL -

    :
    PHP Code:
    <?php
    $self 
    $_SERVER['PHP_SELF'];
    $FName $_POST['FName'];
    $LName $_POST['LName'];
    $UserName $_POST['UserName'];
    $password $_POST['password'];

    if( (!
    $FName) or (!$LName) or (!$UserName) or (!$password))
    {
    $form "   ";

    $form.= "<form action=\"$self\"";
    $form.= "method=\"post\"><table border=0><tr><td>: </td>";
    $form.= "<td><input type=\"text\" name=\"FName\"";
    $form.= "value=\"$FName\"></td></tr><tr><td>: </td>";
    $form.= "<td><input type=\"text\" name=\"LName\"";
    $form.= "value=\"$LName\"></td></tr><tr><td> : </td>";
    $form.= "<td><input type=\"text\" name=\"UserName\"";
    $form.= "value=\"$UserName\"></td></tr><tr><td>: </td>";
    $form.= "<td><input type=\"password\" name=\"password\"";
    $form.= "value=\"$password\"></td></tr>";
    $form.= "<tr><td colspan=2><input type=\"submit\" value=\"\"></td></tr></table>";

    $form.= "</form>";

    echo(
    $form);
    }

    else

    #connecting to MySQL
      
    $conn mysql_connect("localhost""root""rootpassword")
            or die(
    "       MySQL");
      
    #Selecting a DB
      
    $DB mysql_select_db("dostyp"$conn)
            or die(
    "      ");

      
    #Creating an SQL query
      
    $zaiavka "insert into users (FName, LName, UserName, password) values (\"$FName\", \"$LName\", \"$UserName\", \"$password\") )";

      
    #Executing query
      
    $rez mysql_query($zaiavka$conn)
           or die(
    "      $UserName");

      if(
    $rez)
      {
      echo(
    $UserName  ");
      }
    }
    ?>
    FName - varchar 30, null, LName - varchar 30, null, UserName - varchar 20, not null (primary key) password - varchar 16, not null

    " xxx". , SQL , . ?
    | ASRrock Fatal1ty Z97 Killer | Intel Core2 i5 4690K | 4x4GB DDR3 2400MHz Corsair Vengeance Pro | SSD 120GB, Corsair Force SATA III | Western Digital Caviar Green 1TB 5400rpm SATA II | Gainward GTX1060 3GB GDDR5 | Cooler Master HAF-912 | CoolerMaster SilentPro M700 |

  2. #2
    Registered User
    Join Date: Aug:2006
    Location: Sofia
    Posts: 37
    password ( ) MySQL. : `password`.

  3. #3
    Paladin tank in the field Dare_Devil's Avatar
    Join Date: Jan:2005
    Location:
    Posts: 939
    . "pass", - .
    | ASRrock Fatal1ty Z97 Killer | Intel Core2 i5 4690K | 4x4GB DDR3 2400MHz Corsair Vengeance Pro | SSD 120GB, Corsair Force SATA III | Western Digital Caviar Green 1TB 5400rpm SATA II | Gainward GTX1060 3GB GDDR5 | Cooler Master HAF-912 | CoolerMaster SilentPro M700 |

  4. #4
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    echo mysql_error()?

  5. #5
    Registered User
    Join Date: Aug:2006
    Location: Sofia
    Posts: 37
    , : MySQL - , .

  6. #6
    Paladin tank in the field Dare_Devil's Avatar
    Join Date: Jan:2005
    Location:
    Posts: 939
    - , .
    | ASRrock Fatal1ty Z97 Killer | Intel Core2 i5 4690K | 4x4GB DDR3 2400MHz Corsair Vengeance Pro | SSD 120GB, Corsair Force SATA III | Western Digital Caviar Green 1TB 5400rpm SATA II | Gainward GTX1060 3GB GDDR5 | Cooler Master HAF-912 | CoolerMaster SilentPro M700 |

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 |