I keep trying this code below but for some reason it will not put the value in the database. The table in the database is named 'all'. I get no errors when running the script either.
$user = '0';
$bet = '0';
try
{
$pdo = new PDO('mysql:host='. $host .';dbname='.$db_name_wd, $db_username, $db_password);
if($pdo){
echo 'works';
}
$query = $pdo->prepare('INSERT INTO all (w_id,w_amt) VALUES (?,?)');
if($query){
echo' works2 ';
}
$query->bindValue(1, $user);
$query->bindValue(2, $bet);
$query->execute();
//echo $user;
echo $user;
}
catch (PDOException $e)
{
exit('Error Connecting To DataBase');
}