sql >> Database teknologi >  >> RDS >> Mysql

PHP Form sender tomme data til mySQL

Bedre måde at gøre det på er..

<?php

if( isset($_POST['submit']) )
{
    $prefix     =   $_POST['prefix'];
    $firstname  =   $_POST['firstname'];
    $lastname   =   $_POST['lastname'];
    $phone      =   $_POST['phone'];
    $school     =   $_POST['school'];
    $teammate1  =   $_POST['teammate1'];
    $teammate2  =   $_POST['teammate2'];
    $games      =   $_POST['games'];
    $division   =   $_POST['division'];

    mysql_connect("localhost", "acsp", "passwordhidden");
    mysql_select_db("logicgames");
    $order = "INSERT INTO data_logicgames (prefix, firstname, lastname, phone, school, teammate1, teammate2, games, division) VALUES ('$prefix', '$firstname', '$lastname', '$phone', '$school', '$teammate1', '$teammate2', '$games', '$division')";
    $result = mysql_query($order);
    if ($result) {
        echo "<p>Success</p>";
    } else {
        echo "<p>Failed</p>";
    }
}
else
{
    echo "<p>Failed</p>";
}
?>


  1. Find Weblogic Server Version/Patches i EBS R12.2/ Standalone Weblogic

  2. doktrin dbal querybuilder som udarbejdet erklæring

  3. Databasemodellering til internationale og flersprogede formål

  4. MySQL Konverter ROW_NUMBER() OVER PARTITION