WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

SQL Server Error Preventing Data Saving

Brem

New member

0

0%

Status

Offline

Posts

35

Likes

0

Rep

0

Bits

185

3

Months of Service

0%
```php
<?php
session_start();
require_once('includes/config.php');
require_once('includes/functions.php');

if (isset($_POST['Submit'])) {
$email = clean($_POST['email']);
$email2 = clean($_POST['email2']);
$password = clean($_POST['password']);
$password2 = clean($_POST['password2']);

if ($email == "" || $email2 == "" || $password == "" || $password2 == "") {
$error .= 'Error';
} else {
if (strlen($password) < 6){
$error .= "Password";
}
if ($password != $password2) {
$error .= 'Password';
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error .= 'Incorrect Email';
} else {
$statement = $pdo->prepare('SELECT * FROM Accounts WHERE email = :email');
$statement->execute(array(':email' => $email));
$rows = $statement->fetch(PDO::FETCH_ASSOC);
if($rows) {
$error .= 'Incorrect Email!';
}
}
}

if (!isset($error)) {
$statement = $pdo->prepare('EXEC WZ_ACCOUNT_CREATE :ip, :email, :password, 0, 0, 0,');
$params = array( ':ip' => $ip, ':email' => $email, ':password' => $password );
if ($statement->execute($params)) {
echo 'Error!';
}
} else {
echo $error;
}
}

?>

Register / Sign Up
Register Kay?t

<?php
$server = "ss";
$username = "ss";
$password = "ss";
$database = "ss";

$ip = $_SERVER['REMOTE_ADDR'];

try {
$pdo = new PDO("sqlsrv:Server=".$server.";Database=".$database."", $username, $password);
} catch (PDOException $e) {
echo $e->getMessage();
}
?>

I am trying to save data to the database but it's not saving, what could be the reason?
```
 

249

6,622

6,642

Top