The MySQLi extension, or as it is sometimes known, the MySQL Improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer. The MySQLi extension is included with PHP versions 5 and later.

learn more… | top users | synonyms

0
votes
0answers
38 views

PHP-Sanitizing/Validation Myqli prepared statements 2016

I'm currently working on sanitizing/validating user input that will be stored on mysql database with the help of password_hash(). I have 4 variables( $first_name, $last_name, $email, and $psword_match ...
2
votes
2answers
42 views

PHP crawler to collect comments on articles

I have code that parses through web pages finds commentaries and saves commentary info in DB. I have an array where all necessary pages are stored. I iterate through all these pages one by one and ...
10
votes
3answers
892 views

Inserting OAuth data into a database

I am totally new to PHP. I just wrote a PHP script for google oauth to pull the data and insert into my database. I don't know if my code is vulnerable to SQL injection. Should I have used prepared ...
-2
votes
1answer
55 views

Adding tables and values to a database

I am having problems with my code because I am using a system called styleci. Can you please check it? How can I make it better and more secure? ...
3
votes
2answers
70 views

First user login function: Security and efficency opinions

I am writing an application for work. This application will sit on a closed network but I still have to be concerned about security. There will be a maximum of three types of user for this ...
-1
votes
0answers
37 views

Incrementing a view counter [duplicate]

This is a script for count page hits. Can you please tell me if it's danger to mysql injection? ...
6
votes
5answers
425 views

Function to get rows from database

I have a function that returns rows from my database, and it works fine, but I was told that it was poorly written, and there is a lot of unnecessary code in it. I'm wondering if there is a simpler, ...
2
votes
2answers
215 views

Inserting JSON array data into a MySQL database using PHP

Here I am parsing a JSON array and inserting it into a MySQL database. The JSON Array comes from my android code. This is how my JSON array looks like: ...
2
votes
1answer
57 views

Security of login form using prepared statements

I've prepared a simple login form, using prepared statements to prevent SQL injections. How secure is this ? ...
0
votes
2answers
65 views

Custom MySQLi connector class for PHP

I have written a class that connects to a database using MySQLi and has methods for the connection itself and returns the instance of the MySQLi class. This works, but feels a little "clunky" and ...
-2
votes
2answers
57 views

Authentication check in index.php file

I am aware that this code is vulnerable for SQL injections, but I don't know how to avoid it. ...
4
votes
1answer
140 views

Converting uploaded video and saving preview images

I'm coding a basic video upload system for a client. The uploaded videos will live on the page using the HTML5 video element. Essentially what I've done is call the following PHP script ...
0
votes
1answer
30 views

Applying prepare statements

I don't feel that my code is secure, and would like some help in using prepare statements for the following; ...
2
votes
3answers
125 views

Checkout (page) backend

I am developing an e-commerce site and am confused about this. Customers come on the site and add some products to the cart. Customers click on the checkout link if already logged in, then will go ...
2
votes
2answers
87 views

Registering usernames and passwords to a database

Here is my script that registers a user to a database. I am still very much a newbie when it comes to this topic so any guidance would be greatly appreciated. ...
1
vote
1answer
48 views

Handle data received by Ajax request and update database (prepared statement)

I have an Ajax request from a page where the user is being asked to enter their date of birth. The request URL file has the code below and works all good. However, I'll be rewriting all MySQL/MySQLi ...
6
votes
2answers
113 views

Password recovery program

This is a password recovery program I made, and I just want it checked out. These aren't all the files for the login and register system, only the password recovery part. The columns in the ...
0
votes
1answer
65 views

Website registration

Can you please tell me how to improve this code? ...
4
votes
1answer
120 views

Database connection wrapper class

I am trying to create a PHP / MySQLi wrapper class that uses prepared statements, the goal of the class is to create a connection to the Database, then INSERT / ...
2
votes
1answer
71 views

Secured Database Insert

I've been working on a safe inserting method for a while, and I think I've found a pretty secure way to do this. Would you CRitters mind taking a look at it and maybe give me some tips to improve my ...
5
votes
1answer
177 views

Website user password verification

I have a login web page where a user enters their email and password and I need to check if: the entered email exists in the DB and the entered password matches the hashed one from the db. The ...
8
votes
1answer
565 views

Basic registration page and database insertion

Please review my registration code and suggest what changes I should make to improve security. I'm new to PHP and this is my first project. Also I have no Idea how to make a "forget password page" as ...
4
votes
3answers
569 views

Preparing and executing MySQL SELECT query from parameters

I am trying to make a function for Select statements. It will give result based from the parameters passed. I tried using it and it gives the results I am expecting. I know that it is still ...
5
votes
1answer
141 views

MySQLi library for handling MySQLi interactions

I wrote this class recently to better structure and handle MySQLi related interactions with PHP and would love to get some feedback. ...
4
votes
2answers
675 views

Dropdown form that shows data from 2 different tables

I am very new to this and am using php and MySQLi to create a form which will create a record in a third table. This works fine but I can't help but think that there is a way to do it with a single ...
2
votes
1answer
52 views

Placing navigation items into an array

I am looking for better ways to write this code. At the moment it grabs a list of all navigation items and places them into an array (using PDO). However, as you can see, it is using two ...
4
votes
2answers
274 views

Shopping cart login and coupon code validation

I am figuring out how I could make the following query more secure: I have already used mysqli_real_escape_string but I doubt that adds much to security. I have ...
3
votes
2answers
136 views

Single MySQLI query to check for admin privileges

I have this script on top of all pages to check if user is admin otherwise we kick him. The problem is that I don't know if I am using double resources with a double query and results. Can I make this ...
2
votes
3answers
1k views

A very secure procedural MySQLI login script against injections

I know there are other ways to create a login script like Object Oriented, Prepared Statements and PDO, but how about those old MySQL PHP users like me trying to change from old style to the new ways? ...
8
votes
2answers
403 views

A PHP User System

This PHP User System was built with MySQLi and I also used Composer. I'm planning to improve this, and add more stuff and release it as a sort of a module for Composer. User.php (Controller File in ...
6
votes
4answers
946 views

Create a 2D array from SQL table

I am a beginner to PHP programming. I wanted to make a 2D array that would store the values of a table into the array. Below is the Frankenstein code I created (every time I wanted to achieve a task ...
7
votes
3answers
2k views

A Simple, One-Page PHP Admin Login (with prepared SQL statements)

First off, I want mention that this code works well. This is more of a request for suggestions... We're attempting to program a one-page, recursive, token-based admin shell that is safe from ...
1
vote
1answer
33 views

PHP form to database fit for purpose

This code is intended to take input from a form and append it to a database table. The same data is sent to a separate function for subsequent mailing to the respondent. I'm self-taught and it works ...
-1
votes
2answers
130 views

MySQL query in nested loop to get scores and averages for students

I am trying to get the scores and average for all assignments for records in a MYSQL database. The code below works but seems to take quite a bit of time to run because of the nested while loop. Any ...
2
votes
1answer
87 views

Combine Mysql limit query

Is it possible to combine these queries into one query? I am trying to see and average all scores but also count and average just the last three based on the same grouping. This is the main query: ...
7
votes
2answers
805 views

Preventing SQL injection by converting all characters to their ASCII values

In order to prevent SQL injection, I'm converting every character of a string to be inserted in the database into its ASCII value before performing the query. In order to read the value of the string ...
3
votes
1answer
227 views

A User class for visitors to register and log in to a site

I'm just looking for some feedback on my User class. The class is designed to handle users being able to register, login, and logout of the site. I'll be using it in conjunction with a forum I'm also ...
0
votes
1answer
68 views

API POST to save a new item in a Database via PHP & MYSQLI

Is this correct MYSQLI implementation? IS it safe from injection? IS the object cleanup done properly? ...
2
votes
0answers
56 views

Custom 503 page for MySQLi connection error

I redirect all my requests to index.php via htaccess and the code below is in my index.php. I want to ask if my code is properly set for a custom 503 page for an unsuccessful MySQLi connection trial. ...
3
votes
0answers
360 views

Web service for Android clients to store images

I wrote this code for Android server interaction. The way I built the client was an onSharePreference of strings includes photo encoded to a base64 ...
6
votes
2answers
5k views

PHP registration/login form

I'm fairly new to MySQLi and PHP, but I've been working at it for a bit now, and reading up on how to make secure login forms, avoid SQL injection etc. I'm a mere amateur though. I've created an ...
3
votes
2answers
226 views

Programming MySQLi prepared statements

I'm programming code with MySQLi prepared statements. I'm a beginner and just want to ask to experts if my code is correct. ...
4
votes
2answers
5k views

Simple PHP Login Register Script with OOP

I am relatively new to programming and OOP in PHP. I tried to create a Simple Login Register Script using my basic knowledge of OOP. I'm sure my code can be better in a lot of way. I'm trying to code ...
3
votes
1answer
105 views

Inserting data into database

I started learning PHP and MySQL, was using MySQL_ functions. Then I learned they are deprecated, had to choose between PDO and MySQL. I chose MySQL and started using it. As I learn OOP PHP, I ...
5
votes
1answer
208 views

Security of login and register system

I need some help with my register and log in functions. I'm not sure if I have understood bcrypt correctly either. I'm doubting the security of it, what do you ...
0
votes
2answers
145 views

Dynamic connections classes

I have an abstract Connection class which looks like this: ...
3
votes
1answer
104 views

Calling a MySQL procedure with an arbitrary parameter on a GoDaddy website

I'm deploying a PHP project, and I always try to use prepared statements, but unfortunately, GoDaddy does not have the mod mysqlnd which I use it for the function ...
2
votes
1answer
223 views

Script for a multi-user webapp database connection

I have the following working script which I use for my database connection for a multi-user webapp. I use a different database for the login, this script is called only after the user is successfully ...
1
vote
1answer
203 views

Database update script

Previous question: Database input script I'd like this new question reviewed. ...
3
votes
1answer
124 views

Database input script

Is this code secure and valid? If so, can it be improved? ...