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
1
vote
0answers
65 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....
3
votes
2answers
82 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 ...
5
votes
3answers
149 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 ...
2
votes
1answer
72 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 ...
1
vote
1answer
53 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: ...
4
votes
1answer
50 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 ...
3
votes
1answer
40 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 ...
-1
votes
1answer
56 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 ...
3
votes
1answer
45 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 ...
1
vote
2answers
56 views

Inserting a user sign-up record using mysqli

My Code: Connectivity(php) ...
1
vote
1answer
47 views

Fetching table using mysqli, closing statement before displaying results

I am confused if I can do like this: ...
1
vote
1answer
91 views

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

i want to know can this be hacked/injected? ...
1
vote
1answer
76 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 ...
2
votes
2answers
91 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 ...
5
votes
2answers
78 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 ...
1
vote
1answer
54 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 ...
1
vote
2answers
182 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: <...
2
votes
1answer
308 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 ...
3
votes
1answer
96 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 ...
2
votes
3answers
238 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 ...
0
votes
1answer
74 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 ...
1
vote
3answers
184 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 ...
1
vote
2answers
174 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 ...
2
votes
0answers
1k views

PHP login script using mysqli

Can you guys tell me if my login is secure? Login.php ...
2
votes
1answer
57 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: ...
1
vote
2answers
63 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 ...
0
votes
2answers
73 views

Tracking employee data

We have hundreds of employees and for tracking each employees' data, and I am using this code: ...
1
vote
0answers
48 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 ...
1
vote
2answers
121 views

Encoding multiple rows from prepared statement in php [closed]

I have this code that hypothetically returns multiple rows from a database and encodes them in a JSON. I am wondering if this is the best and most presentable way to do it. Note: I am using msqli ...
1
vote
1answer
462 views

PHP Prepare statement shortcut class

I did some looking around and found some more topics on how to use the $stmt->bind_param function inside another function or class what means the reference variables have to be sort of passed on. With ...
1
vote
0answers
36 views

Log in page using MYSQLi

I need to review my code. I used prepared statements to select data from the database. Is there more sanitization needed or any other problem in the code? Rate it, please. Thanks. ...
1
vote
1answer
97 views

Entering users into a MySQLi database

This is a form that I want to use to enter users into a database. I used MySQLi with prepared statements. I want to make sure that I sanitized my data well. ...
-2
votes
1answer
76 views

My code is contain some vulnerabilities, how can i correct it and make it better

My code works well, but i still don't think it is well written. Can someone help to improve the code so as to get rid of vulnerabilities. My php code: ...
1
vote
1answer
784 views

Security of User Add/Edit/Delete MySQL table

I have the following code which is working fine, however I am concerned around the security of this code and considering I am relatively new to php I was wondering whether the below code is secure? I ...
5
votes
1answer
438 views

PHP login script

I'm hoping someone would be able to identify if my code is prone to SQL injections, and just overall see if there is anything that could be done better. This is also my first time using MySQLi ...
3
votes
1answer
2k views

PHP > 7.1 - MySQL Session Handler Class with some built-in time-management/security

I've created a class that implements the native SessionHandlerInterface (with added PHP v7+ functionality) while adding some minor security features. My main goal was to maintain native methods for ...
11
votes
3answers
671 views

Secured registration script

I created code for my registration form on my social network. I want to know if it is secured enough to release on the web as a public social network. Also, all of the code works. I just want to make ...
2
votes
1answer
119 views

SELECT/INSERT between DB2 and MySQL

I've spent a week getting a very old script that runs between DB2 and MySQL condensed and functioning but I've been told the last few days on SO that my code is horrible and confusing and shouldn't ...
0
votes
2answers
146 views

Displaying the value of a stock portfolio

Some people have mentioned to me that my site is quite inefficient and given that it's taking ~17 seconds to load now, I'd like to change that but I've no idea how. I've tried Gzip to compress it but ...
5
votes
1answer
153 views

PHP - First Login System

I am quite new to PHP, and with the help of a few tutorials have made this login system. However I know its not as efficient and compact as it could be, also I am looking for ways to improve the ...
1
vote
1answer
135 views

PHP member login system

I have php cookie based login system on my website using below given code. I want to know that whether this login system is secure or not, Whether it can be hacked in any way? ...
4
votes
1answer
5k views

PHP MySQLi wrapper class

I've created a minimal PHP-MySQLi database wrapper class that can be used to run insert, select, update and delete queries via prepared methods with ease. Here's the wrapper class: ...
1
vote
1answer
116 views

PHP exercise to read or write database values

I just came up with the code below but I'm wondering if there is room for improvement? I.e. better readability and or performance, better structure, less lines of code? The script should parse a ...
2
votes
1answer
158 views

OO and non-OO usage of Mysqli

I'm starting to learn the object oriented aspect of PHP. In this regard I made a small "exercise" of sorts "translating" one of my PHP functions into OO mode of PHP. I'm asking if there are there any ...
-3
votes
1answer
53 views

Optimize mySQL query [closed]

I have the following query: ...
-1
votes
1answer
1k views

Mysql flexible insert record with bind_param or bind_value

I want to insert rows in a database table with the precaution of SQL-injection. I'm using below flexible MySQL insert function, which enters a record in a given table. Is this the best approach or is ...
0
votes
1answer
162 views

PHP & MySQLi Login Script - Is it safe from Injection?

I've been geeking up on MySQLi prepared statements to avoid potential SQL injection and I have managed to modify my legacy code (previously just using mysqli_real_escape_string). I am looking for ...
1
vote
1answer
1k views

Separate areacode from phone number string with MySQL Database

I have a database with 5000 entries of local area codes to separate the area code from a phone number string. I'm not sure if the code I use is the fastest way to solve these job. I shrink the ...
2
votes
1answer
83 views

Switched from MySQL to MySQLi requires the connection parameter

I was working with really old PHP I learned years ago and decided to finally update it, so I changed all the mysql to mysqli. I ...
0
votes
1answer
45 views

Checking whether a user is on the donors list

I was wondering if I could please get some justification if the PHP code I wrote using Mysqli prepared statements would be able to withstand SQL injection attacks. I have one field that gets a value ...