I am new to PHP and have written the following php code for an entry form on my website:

if ($_FILES['photo']['error'] == 0) {
// Move the file to the target upload folder
$target = WS_UPLOADPATH . $photo;
if (move_uploaded_ file($_FILES[('photo']['tmp_name'], $target)) {
// Connect to the database
$dbc = mysqli_connect( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

...