how to upload multiple files in database with this script also i want to make the input file and database not required What do you think? Is the script protected? Here's my php pdo script: $file = $_FILES['file']; $fileName = $_FILES['file']['name'];
Started learning a little PDO now after a few suggestion on sites to look at from helpfull users here. I'm still fresh, so i dont want the full solution, but a point in the right direction since i am a little unclear on what to type in. I have two pr
I tried connect IBM database through PDO using below code. But, it is not working try { $db = new PDO("odbc:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=BLUDB;HOSTNAME=hostname;PORT=50000;PROTOCOL=TCPIP;", "username", "password"); e
I'm trying to query against a BIGINT primary key on a MSSQL database and some of the returned values turn up rounded, different than the ones stored in the database: See screenshot here 9200000000000359 exists in the DB, as well as 9200000000000361.
I have a client that use my web application for debts control. He wants to save and backup all data so if something happened to his laptop, he could repair his data. I told him to enter to phpmyadmin and click on export, but he think that it is littl
I have a php script that runs a simple SELECT query, and it seems to work fine. Here's the script: error_reporting(E_ALL); ini_set('display_errors', 1); try { $hostname = "localhost"; $username = "root"; $password = ""; $db =
I have currently a script to insert new data automatically when using the form to add a new element. I use public string PDO::lastInsertId ([ string $name = NULL ] ) Logic of course. Now I am only wondering if this might cause any problems in case a
here is my Index file: <!Doctype html> <html> <head><title>The Database Entry Project</title></head> <body> <div> <form> <h3>Input Details Here</h3> <label for="fn">First Na
I am trying to send a group of variables and using PDO to insert into my database, however when i run the page, i get an empty message box and nothing is happening on the page. This is how I am getting the user inputs. <div class="caption1" c
I am looking for a way to increment and decrement by a step of three records in a table and return them. Say ID '4' is currently active. I want to get the next 3 and the previous 3 records with IDs and category of 3.2.1 and 5.6.7 (via incrementing an
I am having issues inserting double quotes into my mysql database. I had to change headers to UTF8 since I will be displaying Spanish (ñ, accents). I run a page (PHP) to insert a message in my database: header('Content-Type: text/html; charset=utf-8'
My PDO query won't work. This is my page: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta
Since im too new in PHP, i dont know how to pass a PDO variable to another class? This is settings file for connection. <?php try { $kullanici = 'root'; $sifre = ''; $baglan = new PDO ("mysql:host=localhost;dbname=ders", $kullanici, $sifre);
I'm very new to PHP/Mysql and I naturally have a few questions. I was following a youtube tutorial on creating a simple dynamic website that pulls data content from a MySQL database then displays the content on a single PHP index page. I followed thi
I have been trying to work out prepared statements, and using $_POST variables in it, but nothing I've seen online seems to work. I know that questions are meant to show proper research, but I can't find anything that matches this question online. Pl
I am using JQuery to check if username is in use, however I have some issues. It is always stuck of "Searching". Image below shows exactly what the issue is. Register.JS: $(document).ready(function(){ $('#username').keyup(function() { var userna
I'm just using PDO to insert customers into my table but it has been overcomplicated by something which is unexplainable by myself or other research. It gives the error code: 00000 (which means that is a success, apparently) but no data was actually
I am trying to get data from a database using PHP and PDO, here it is a snippet from my code: $query = $this->dbconn->get_db_access()->prepare("SELECT id from blog_posts ORDER BY pub_date DESC LIMIT :s, :l"); $query->bindParam("
This question already has an answer here: Reference - frequently asked questions about PDO 3 answers I have an update query $query = $db->prepare("UPDATE user SET UserID='6',UserName='xyz' WHERE UserID= '6' "); $query->execute(); it runs f
im still in the early learning stages, banging my head against walls looking for clues. Iv been reading the manual to no avail. im building a user log in system based on the phpAcadamy tutorial 'Register & Login'. They use mysql_connect in the tutori
I read a lot of similar topics, but i can't understand my mistake. Problem: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined' in I:\home\lm.ru\www\classes\db.class.php:39 Stack trace
I have made a login function only i get a internal server error. I have checked the function but i don't see the issue. If i use this: function login($username, $password) { if (!isset($username) || !isset($password)) { return false; } if ($this->db-
I am using the bellow query to update but now I tried to change it to pdo and it failed to work Please any help will be appreciated function updateonlinesession(){ if(isset($_SESSION['username']['id'])){ $uid = $_SESSION['username']['id']; $page = $_
I'm using PDO to connect to an MS SQL 2000 database and want to create a left join to another database on the same SQL 2000 server. This query returns the correct results when run on the MSSQL query analyser and pulls the data from both databases as
I'm trying to fetch all records from my table on my site, I have the following $sth = $conn->prepare("SELECT * FROM directory WHERE user_active != ''"); $sth->execute(); /* Exercise PDOStatement::fetch styles */ $result = $sth->fetch(PD
I am still redoing and getting rid of old mysql_* commands in my code. I tried to transfer my session login form old code and this is what I got so far: public function login($user, $password) { if (!empty($user) && !empty($password)) { $password
I'm pretty sure, a common problem but am looking for the best practice solution. I have a legacy database, for which I have written a script to migrate the data. In my script I have the following: $select = $dbh->query("SELECT CollectionID, Collec
I've only just started working with prepared statements, and my first few examples worked out great, but now I'm running into an SQL syntax that I don't understand. I have a function that performs an INSERT, taking a parameter of an associative array
From the PDO manual: PDOStatement::rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatement object. If the last SQL statement executed by the associated PDOStatement was
I had this previously in my normal mysql_* connection: mysql_set_charset("utf8",$link); mysql_query("SET NAMES 'UTF8'"); Do I need it for the PDO? And where should I have it? $connect = new PDO("mysql:host=$host;dbname=$db",