2022 Developer Survey is open! Take 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
65 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 ...
user avatar
0 votes
0 answers
39 views

Adding more fields to a Questionnaire in a CRUD system

Background on Project When a customer orders a machine, I have to do something called a telephone site survey, which involves asking them questions about their site making sure everything is okay ...
user avatar
3 votes
2 answers
165 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 ...
user avatar
2 votes
1 answer
349 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... ...
user avatar
2 votes
1 answer
34 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 ...
user avatar
-2 votes
1 answer
194 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), ...
user avatar
-1 votes
2 answers
118 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 ...
user avatar
2 votes
1 answer
31 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", &...
user avatar
  • 121
3 votes
1 answer
88 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 ...
user avatar
3 votes
1 answer
66 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. ...
user avatar
2 votes
3 answers
69 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 ...
user avatar
1 vote
2 answers
103 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. ...
user avatar
1 vote
2 answers
2k 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: ...
user avatar
2 votes
1 answer
68 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 ? ...
user avatar
3 votes
2 answers
361 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 ...
user avatar
3 votes
1 answer
123 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 ...
user avatar
4 votes
2 answers
185 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 ...
user avatar
1 vote
1 answer
123 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 ...
user avatar
  • 107
3 votes
1 answer
67 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 ...
user avatar
1 vote
1 answer
326 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 ...
user avatar
1 vote
0 answers
41 views

InnoDB Row Locking with Transaction & Helper [closed]

I have recently started to work with InnoDB as well trying to use "helper" functions. The code below seems to work correctly however I am not sure if the true ...
user avatar
7 votes
2 answers
641 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 ...
user avatar
1 vote
0 answers
76 views

The code is displaying my mysql table in a bootstrap table using php templates

I am trying to simplify the code so i do not need to make a new add_content function and home template every time my homepage content gets bigger. template_class....
user avatar
3 votes
2 answers
151 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 ...
user avatar
  • 107
5 votes
3 answers
181 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 ...
user avatar
  • 1,092
2 votes
1 answer
1k 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 ...
user avatar
2 votes
2 answers
129 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: ...
user avatar
  • 171
4 votes
1 answer
106 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 ...
user avatar
  • 171
3 votes
1 answer
46 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 ...
user avatar
-1 votes
1 answer
59 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 ...
user avatar
  • 13
3 votes
1 answer
49 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 ...
user avatar
  • 33
1 vote
2 answers
61 views

Inserting a user sign-up record using mysqli

My Code: Connectivity(php) ...
user avatar
1 vote
1 answer
50 views

Fetching table using mysqli, closing statement before displaying results

I am confused if I can do like this: ...
user avatar
  • 215
1 vote
1 answer
256 views

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

i want to know can this be hacked/injected? ...
user avatar
  • 215
1 vote
1 answer
93 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 ...
user avatar
  • 215
2 votes
2 answers
102 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 ...
user avatar
  • 9,476
5 votes
2 answers
100 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 ...
user avatar
1 vote
1 answer
56 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 ...
user avatar
1 vote
2 answers
584 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: <...
user avatar
3 votes
1 answer
2k 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 ...
user avatar
3 votes
1 answer
103 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 ...
user avatar
4 votes
3 answers
336 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 ...
user avatar
0 votes
1 answer
153 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 ...
user avatar
4 votes
3 answers
247 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 ...
user avatar
1 vote
2 answers
504 views

Use a comma-separated field in another SQL query

I was just wondering if there was a better way to write this block of code in php. I have a string with values separated by commas. I need to prepare that string to pass it on to the query using IN ...
user avatar
  • 39
2 votes
0 answers
1k views

PHP login script using mysqli

Can you guys tell me if my login is secure? Login.php ...
user avatar
2 votes
1 answer
61 views

Showing all records on a webpage

I have a connection with my database to show all my records on a webpage, and I'm not sure if this code is safe: ...
user avatar
  • 63
1 vote
2 answers
71 views

Merge both sql queries into one to get the performance

Currently i am using 2 queries - one for reattemptdate & one for holddate.... if we merge both queries & get the results in single query , than will it give better performance? if so how to ...
user avatar
0 votes
2 answers
77 views

Tracking employee data

We have hundreds of employees and for tracking each employees' data, and I am using this code: ...
user avatar
1 vote
0 answers
61 views

Displaying topics in a PHP forum

I am very new to PHP. I've only been using it for a few months. I'm currently attempting to build a forum and wanted feedback on some of the code I have so far. These are two files I feel like could ...
user avatar

1
2 3 4 5 6