Category : pdo

I am in the process of converting a MySQL platform to MSSQL and in the process I’ve run into some issues, which I’ve been unable to solve. I have the following queries which I am trying to output: $queryDiskOperationLog = "SELECT * FROM Computer"; $queryCpu = "SELECT * FROM Cpu"; $queryGPU = "SELECT * FROM ..

Read more

I’m using this class code to insert data into the database: <?php Class User { private $error = ""; public function signup($post) { $data = array(); $data[‘name’] = trim($_POST[‘name’]); $data[’email’] = trim($_POST[’email’]); $data[‘pass’] = trim($_POST[‘pass’]); $pass2 = trim($_POST[‘pass2′]); if(empty($data[’email’]) || !preg_match("/^[0-9a-zA-Z_-][email protected][0-9a-zA-Z_-]+.[0-9a-zA-Z_-]+$/", $data[’email’])) { $this->error .= "Please enter a valid Email <br>"; } if(empty($data[‘name’]) || !preg_match("/^[a-zA-Z]+$/", ..

Read more

I want to connect a Postgres database with pooling:true. Can we do it with PHP new PDO option? If not are there any reliable options? I want to pass the below parameters(similar) while establishing the connection: Pooling=true;Minimum Pool Size = 2;Internal Command Timeout = 0;Command Timeout = 0; I cannot find any such details in ..

Read more

I got this error ‘Fatal error: Uncaught Error: Class ‘UserController’ not found in /home/dlotjryh/public_html/dashboard/login.php:4 Stack trace: #0 {main} thrown in /home/dlotjryh/public_html/dashboard/login.php on line 4 ‘ just when i upload my file, the page we working fine on my localhost, I checked the php verion, they are both 7.2 <?php include_once ‘classLoader.php’; ?> <?php $userC = ..

Read more

error form I am stucking on this error for hours ,and i still didn’t figure out. I am trying to to get this lab soon. Your helps would be appreciated. Thank you guys. //controllers/chirp.php function post_add() { $chirp_content = safeParam($_POST, ‘chirp_content’, ”); $author = safeParam($_POST, ‘author’, ”); insert($chirp_content,$author); redirectRelative(“index”); } //Models/chirp.php function insert($chirp_content,$author) { global ..

Read more

error form I am stucking on this error for hours ,and i still didn’t figure out. I am trying to to get this lab soon. Your helps would be appreciated. Thank you guys. //controllers/chirp.php function post_add() { $chirp_content = safeParam($_POST, ‘chirp_content’, ”); $author = safeParam($_POST, ‘author’, ”); add_chirp($chirp_content,$author); redirectRelative(“index”); } //Models/chirp.php function add_chirp($chirp_content,$author) { global ..

Read more

I’m trying to bind variables to a PHP PDO query The variables $breed_var, $species_var & $year_var represent form inputs so they might be integers or empty/null Here’s my code : <?php $breed_var = 11; $species_var = ‘species’; $year_var = 2016; echo "<h1>Test</h1>"; $db_servername = "xxx"; $db_username = "xxx"; $db_password = "xxx"; $db_dbName = "xxx"; $pdo ..

Read more