Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [mysqli]

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.

Filter by
Sorted by
Tagged with
4 votes
2 answers
246 views

A PHP class for the common database operations?

I'm a CS undergrad, so I don't have much experience. But while coding vanilla PHP projects, I found that I was repeating myself a lot with the CRUD operations. So overtime, I developed a single file ...
sammy medawar's user avatar
0 votes
1 answer
79 views

PHP login codes suggestions

Now i have a fully functional PHP codes for login and registeration i was wondering if anyone could offer improvements to the code The code: Config.php: ...
Bebo's user avatar
  • 39
1 vote
1 answer
140 views

Follow up to Validation Script in PHP

So I've implemented the suggestions in Original question And now my code looks like this: ...
Bebo's user avatar
  • 39
1 vote
1 answer
117 views

PHP Validation script

The code below is modified slightly from the code in this previous post. I believe the code below could be improved and more secured but i don't know how so someone please show me how an improved ...
Bebo's user avatar
  • 39
0 votes
1 answer
221 views

SQL & PHP login method

My code is working however it seems to be using old outdated php version so less secure and I'm still new to programming so I'd be more than thankful if someone shows me how an improved updated and ...
Bebo's user avatar
  • 39
3 votes
1 answer
233 views

PHP MySQLi Wrapper Class For API

I've never had my code reviewed before, so I am taking this opportunity to see what can be improved with my coding style. I am still somewhat "new" to PHP, in the sense that I'm an old dog ...
Bellator's user avatar
  • 131
1 vote
0 answers
24 views

Use API data to ensure current product prices in database data then sort by price

Because I've waited until now to bother learning the magical JSON functions that modern MYSQL affords, I wonder if my code is optimally written and if there are cautions/limitations to be aware of. My ...
mickmackusa's user avatar
  • 8,674
4 votes
3 answers
389 views

Queries to get products selected in multiple stores

Project description I'm making a website listing products. The listing goes as following (See here): Product name Shop name Price in that shop If the product appears multiple times in the table for ...
Alpha.Ars's user avatar
4 votes
4 answers
490 views

Functions in PHP to run basic MySQL crud

I wrote a list of functions in PHP that I want to use in my pet project as an autoloaded file for all parts of the app. The purpose of these function is to shorten the code you write for MySQL queries ...
Syed M. Sannan's user avatar
4 votes
2 answers
3k views

using PHP and JS to fetch data for an entry

I need to fetch some data from a mysql database. For that I created get_data.php on the server and a js function to retrieve that data on the client. Is this the proper way to do it? What would you ...
Graziano Bolla's user avatar
4 votes
2 answers
295 views

OOP - Contact Form PHP Backend - Procedural to OOP - Dynamic MySQL Prepared Statement PHP

I just converted procedural code to OOP code. Is there any performance or security issue with this code or what should I consider further? interface ...
Thaninayagam's user avatar
2 votes
1 answer
916 views

MySQL database custom session handler using PHP with MySQLi extension

I have made the decision to move the storing of session data to the database. Any new ideas, suggestions are welcome. Please also give security suggestions. Like SQL injection is possible here, etc... ...
Puneet Gopinath's user avatar
2 votes
1 answer
40 views

Input text upload to MySQL DB

I am uploading and selecting code from my MySQL DB and I have a feeling some of it could be written in a much shorter way but I don't know how. Can someone tell me if this is clean code or if it's too ...
user13477176's user avatar
-2 votes
1 answer
208 views

Query builder class pdo,sql

Need some advices to create class that handles sql query operations with given array (having full control of the array and obtaining record information). My code works properly (it is just example), ...
Anarchy's user avatar
-1 votes
2 answers
139 views

My Script Inserts users into a database and hashes the password, I need to know how to prevent SQL injection with Procedural-Oriented MySQLi [closed]

My script works but I just want to know how I can protect myself from SQL injection with Procedural Oriented MySQLi. Most of the tutorials are about Object-Oriented MySQLi and I'm not familiar with it ...
Pal Dhillon's user avatar
2 votes
1 answer
38 views

Is there a way to consolidate Ajax dropdowns that filters data from MYSQLi database

I recently started a project which has a database of rail cars for a train simulator. Im trying to set up a way to filter the data based upon 4 categories "Car Type", "Road Name", &...
David's user avatar
  • 121
3 votes
1 answer
96 views

OOP: The correct use of classes and optimizing code

I am trying to improved my coding skills. I mainly work in web development. I had a "system" that I use in all my projects to fetch data from my DB to the browser. I tried an implementation ...
Chris Luna's user avatar
3 votes
1 answer
84 views

Secure upload script

I am creating a social network that let's users upload a profile picture. I just want to know if this is a secure way of doing it. Thanks. ...
user13477176's user avatar
2 votes
3 answers
76 views

Receiving a user's registration submission and inserting row into database #2

I asked this question before and mickmackusa and Your Common Sense gave me some good answers. I went over them and made as much ...
user13477176's user avatar
1 vote
2 answers
111 views

Receiving a user's registration submission and inserting row into database

I have improved my code since the last time asking for its review. I'd like to know if it is up to the current standards. ...
user13477176's user avatar
1 vote
2 answers
4k views

Return row count from mysqli prepared statement

I want to know if it is okay/safe to use a prepared statement and mysqli_num_rows like this: ...
user13477176's user avatar
2 votes
1 answer
79 views

Securely connecting to my DB [closed]

Hello all I have a short question. Is this a good and secure way to connect to my DB ? ...
user13477176's user avatar
3 votes
2 answers
366 views

messages.php file security and efficiency

I am creating a social network and I want to know how secure and clean this code is. I had to update it to prepared statements because I was following a tutorial and even though it was made in 2019 it ...
user13477176's user avatar
3 votes
1 answer
144 views

How secure is my login and signup code

I am creating a social network and I've been told a few times a lot of things are outdated and prone to SQL injections so I am going over everything with a very fine comb and checking what's good and ...
user13477176's user avatar
4 votes
2 answers
195 views

Security of post submission, picture upload and post fetch

I am a newbie and have been following a tutorial I bought on Udemy. But I was told it is old and teaches bad code practices. I used this in some code from my old projects. Now I'd like to know how ...
user13477176's user avatar
1 vote
1 answer
132 views

PHP MySQLi database object

I've been learning more about PHP Objects and Classes, and my immediate reaction was to create a Database Object for handling the MySQLi Connection, Statements and Results. Its not meant to be an ...
sBucholtz's user avatar
  • 107
3 votes
1 answer
84 views

User Class and MySQL Connection Handler

Mainly used Stack Overflow, so first time over here for a code review. I am trying to make some enhancements to a legacy application. I have some minor experience using Laravel, but this application ...
James Pavett's user avatar
1 vote
1 answer
971 views

Custom PHP MySQL database queries function - Suggestions for improvement or additions

For my website needs I made a custom procedural MySQL function in PHP which can INSERT, UPDATE, SELECT or DELETE data from database. I would like a review and any suggestions for improvement or ...
Boris J.'s user avatar
7 votes
2 answers
811 views

PHP MySQLi Connection File

I have recently adjusted the way I create my mysqli connections. Initially I would include the connection file and use ...
FamousAv8er's user avatar
3 votes
2 answers
204 views

Registration form using procedural MySQLi

I'm relatively new to coding with PHP and mySQLi. I want to learn more but I'm really limited in resources. Most of my research went into W3Schools, PHP.net, and of course whatever I could find on ...
sBucholtz's user avatar
  • 107
6 votes
3 answers
269 views

php one-time prepared statement execution function

I use prepared statements often even when I only need to execute the statement once (for security), so I implemented a function to abstract away all the function calls on the mysqli_stmt object, as ...
potato's user avatar
  • 1,122
2 votes
1 answer
2k views

PHP santization of textarea input

My application will accept textarea content that is submitted by a user, and i would like some people to review my code to make sure there is no security vulnerability such as XSS. My mySQL column ...
pabloBar's user avatar
2 votes
2 answers
189 views

Shoutbox system

I wrote a little Shoutbox System which is working fine, but I want to know if there is something I can improve about this code. Here is my Shoutbox Overlay: ...
NvrKill's user avatar
  • 193
4 votes
1 answer
121 views

Demotion/Promotion Script

I wrote a code which is creating a Session and write in the Session Arrays diffrent things like: Username and Rank. I wrote then a function which is checking the Visited Profile Name and Rank and the ...
NvrKill's user avatar
  • 193
3 votes
1 answer
51 views

Creating a booking based on a POST request

I want to make a booking entry. I want to ask whether the code that i wrote below is rightly format or not? I haven't tried it, because there's still more code that needs to be written. I just want ...
PHP Beginner's user avatar
0 votes
1 answer
75 views

Login to a school system and get account type

I'm new to MySQL database design. My question is this database is correctly built or not. We used the users table to login and get account type and here the code to login ...
SARA 's user avatar
  • 23
4 votes
1 answer
52 views

Displaying a user's uploaded posts

I'm working on prepared statements for my website and I'm wondering if it's possible to have multiple prepared statements one after another. In this example, I have 2 select statements. I'm hoping ...
Cole's user avatar
  • 43
1 vote
2 answers
64 views

Inserting a user sign-up record using mysqli

My Code: Connectivity(php) ...
The Puzzler's user avatar
1 vote
1 answer
57 views

Fetching table using mysqli, closing statement before displaying results

I am confused if I can do like this: ...
Ingus's user avatar
  • 215
1 vote
1 answer
581 views

PHP MySQLi Prepared Statements: Can this select query be hacked/injected?

i want to know can this be hacked/injected? ...
Ingus's user avatar
  • 215
1 vote
1 answer
109 views

Simple MySql or MySqli Class

Which one of these methods is better/safer to use? And what benefits could I get using one or other? Simple mysqli: connection.php ...
Ingus's user avatar
  • 215
2 votes
2 answers
116 views

PHP New User Creation

I'm learning more about PHP, so I've decided to create a simple login/create account system. Entering information for creating a new account sends the data to my ...
Linny's user avatar
  • 10.1k
5 votes
2 answers
107 views

PHP password-resetting page

I am producing a PHP code and I want to implement it in my server to do its function. My question is, are there any vulnerabilities that I should correct? I tried to establish the session first then ...
helloworld's user avatar
1 vote
1 answer
65 views

When slide show web page is reopen, the web page loading is very slow

Here is a script that opens about 200 pictures, the first time you open the webpage, loading of the 200 pictures is fast, However if you reopen the page, it takes about 4 minutes to load the same page ...
A. Kiyoshi's user avatar
1 vote
2 answers
841 views

Simple wrapper for PHP mysqli connection

I'm creating some web apis to sync some data between desktop/mobile apps. Working on it, I wrote a simple wrapper for mysqli connection to simplify querying like: <...
Taekmin Lee's user avatar
4 votes
1 answer
3k views

Using singleton pattern for a MySQL connection

I'm new to web programming, and writing some web apis to enable users to sync their data between devices. Is it okay to use singleton pattern to prevent reconnecting the MySQL database on every api ...
Taekmin Lee's user avatar
3 votes
1 answer
112 views

Authentication system (no browser) with mail verification

I made an authentication system for my software (no browser is used) that works like this: User receives a Key on it's mail after buying the software User registers account using that key and inputs ...
Roberto Carlos's user avatar
4 votes
3 answers
390 views

Adding / updating user info into MySQL database

I'm working on an app that will be used for employee management and I'm using MySQL for the database. You can add employees, view/update/delete them, and on the dashboard I'm listing them in different ...
Blagojce's user avatar
0 votes
1 answer
245 views

Simple PHP project to store inputs in MySQL and output them

As my first simple PHP project, I've created a simple project that allows you to just enter your name and two numbers, where it displays them on the page and stores them in a database. It consists of ...
user8758206's user avatar
5 votes
3 answers
359 views

PHP script security for new user registration

I would like to ask the experts here if this is secure. If it is not can I get an explanation as to why it would not be secure? I have been reading off and on on sites for this and I have trouble ...
user2455808's user avatar

1
2 3 4 5 6