Hi all,
I have been trying to get this to work for days now and still I’m stuck!
Can anyone see the problem here and if so can you please let me know how to resolve it? I havent been learning this for long but this is one of the things I need to do to get a piece of work I am building up to to work.
Thanks all.
[php]<?php
//Start session
session_start();
$_SESSION[‘SESS_LOGIN’];
//Include database connection details
require_once(‘config.php’);
$connection = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
if (mysqli_connect_error()) {
die(`Connect Error: ` . mysqli_connect_error());
} else {
echo `Successful connection to MySQL <br />`;
$employ = $_POST['employer'];
$address = $_POST['flat'];
$login_name = $_POST['login_name'] ;
var_dump($connection);
// Insert employer and address into database row for logged in user.
$query = "UPDATE members SET employer = `$employ`, flat = `$address` WHERE login=`$login_name`";
if (!$result = $connection->query($query)) {
echo "No rows updated <br />";
} else {
echo $result . " row(s) successfully updated<br />";
}
}
?>
[/php]