Введение в СУБД MySQL


Example.12.2


<?php

if ($submit)

{

// process form

$db = mysql_connect("localhost", "root");

mysql_select_db("mydb",$db);

$sql = "INSERT INTO employees (first,last,address,position)

VALUES ('$first','$last','$address','$position')";

$result = mysql_query($sql);

echo "Thank you! Information entered.\n";

} else{

// display form

?>

First name:

Last name:

Address:

Position:

<?php

}

// end if

?>




Начало  Назад  Вперед