I made a .bat script, but when I run it, it doesn't detect the included file in my php script.
.bat
"C:\xampp\php\php.exe" -f "D:/Projects/Web projects/done/sticky/test.php"
test.php
<?php
include 'db.php';
try {
//stm
$STH = $DBH->prepare( "INSERT INTO users (username, password, email) values (:user, :pwd, :email)" );
//bind
$data = array( 'user' => 'a', 'pwd' =>'b', 'email' => 'c' );
//exec
$STH->execute( $data );
}
catch( PDOException $e ) {
file_put_contents( 'PDOErrors.txt', $e->getMessage(), FILE_APPEND );
die( "db error" );
}
?>
db.php contains my db info, but the script doesn't detect it. Do note that if I run it normally in my browser, it does work.