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

3
votes
1answer
50 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 ...
-1
votes
0answers
15 views

PHP Class dinamicly execute select query(MySQLI and PHP) [closed]

I have problem to execute select query, 'Select' function do not work, could you help me with it? here is DB.php class, on the end of class is Select function. ...
3
votes
0answers
41 views

Security of login and register system

I need some help with my register/login functions. I'm not sure if I understood bcrypt correctly either. Is this good or do I have to do any changes? Did I miss ...
3
votes
1answer
44 views

Checking if my code is secure

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
88 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
85 views

Database update script

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

Database input script

Is this code secure and valid? If so, can it be improved? ...
3
votes
1answer
56 views

Secure INSERTs with Mysqli

Is this code well protected, and if not, could you tell me how it might be exploited and how to secure it? I'm using mysqli. ...
4
votes
1answer
66 views

PHP MySQL Database class

This is a PHP database class. Yes, I know it's using the MySQL functions, which are deprecated, but I shall be updating it to MySQLi soon. Can you please review this code and give any comment on any ...
5
votes
2answers
272 views

Custom MySQLI Class

I have created this MySQLI Class. I wanted to know if this class is secure enough to be used on the production websites or more improvements can be done to this class. ...
1
vote
1answer
61 views

More maintainable API for wysihtml5 widget

For an HTML calendar with jQuery, I put in event listeners to enable jQuery drag-and-drop that reads and writes to persistence using HTTP get and post with JSON structures. Now I'd like to make the ...
2
votes
1answer
53 views

Class to get user information

I've just begun creating a class to get User information, and I'd like for it to be improved. The global variable $oConni is the database connection. ...
2
votes
0answers
49 views

Merging totals from rows with duplicate IDs

I have the following query which updates the quantity when there are duplicate items and users (there should only ever be 2 duplicates), then deletes the row which doesn't get updated... ...
3
votes
2answers
111 views

PHP framework building: MySQL Connection and query class

I am building a PHP framework and would like to get some feedback on a few different sections of the project so far. I consider myself still a neophyte in PHP so I would like to ask if I'm going about ...
-1
votes
1answer
70 views
3
votes
1answer
151 views

PHP MySQLi database wrapper

I am developing a mysqli database wrapper. I've made an effort to make this as fast as possible and easy to use. However, now I want to start adding callbacks (for ...
5
votes
2answers
87 views

Average of averages

I need to get the average of multiple averages calculated basing on data contained on a sql database. To do that, I'm using this code: ...
5
votes
1answer
101 views

Doing a roll back with multiple MySQLI prepared statement

This is my code for doing a roll back with multiple MySQLI prepared statement. I want to know if anything is wrong with the code. ...
1
vote
2answers
83 views

Does this code avoid SQL injection?

I have the following PHP code but I'm unsure, based on the many things I've read, whether or not this is actually safe from an SQL injection attack. ...
5
votes
2answers
239 views

Database Handler Class

I've written this DB Handler class. Please review it and suggest any code edits or point out mistakes and security loop holes. Please also suggest a better way to handle things, if there is a security ...
2
votes
3answers
323 views

Check if URL contains different strings

The code it self is pretty self explanatory, however i do not think it is very efficient at all. Is there a better way to do this? Its basically so i can track spam sites and save the sites into my ...
4
votes
2answers
431 views

PHP and MySQLi login script - is it secure / am I doing something wrong?

Below is the code for my login page. I haven't really used MySQL (especially OOP) before, so I'd like to know if I'm doing something inherently wrong. The code is working as expected, but I don't ...
7
votes
4answers
1k views

PHP OOP Login Class

This is a login class I made for my personal website. What I don't care about, is how secure this login class is, because I know it's not. But it keeps out the rare unwanted guests because I do not ...
7
votes
3answers
709 views

MySQL update with PHP; MySQLi prepared statement in loop

I'm going to develop an Android application that performs simple MySQL operations by invoking server-sided PHP scripts. PHP-MySQL communication is done by MySQLi extension. Each operation that I'd ...
10
votes
2answers
598 views

SQL injection safety check

I was wondering if my code is safe for sql injection. This code just checks if the username exists in my db or not. ...
4
votes
4answers
560 views

Two while for the same query

If I have to loop results of a query echoing first all fields of a column, then echoing something not to loop, then fields of another column. ...
4
votes
2answers
211 views

Updating necessary data using just one function

My objective is to update necessary data using one function instead of having different functions to update different fields. So, I've created one and I think this is not really elegant, efficient or ...
3
votes
2answers
643 views

Dynamically load data into bootstrap accordion navigation bar

I have made a bootstrap accordion navigation bar that loads data dynamically from a database with PHP. Here are the two tables that I use: ...
3
votes
1answer
65 views

Outputting results from a conditional row count across multiple tables

Follow up question for: Conditional row count across 4 tables After getting some excellent help from 200_success, i managed to output the SUM() total of my query ...
10
votes
2answers
165 views

Update of Classes for user registration and authentication

Old Post: Classes for user registration and authentication This post is an update of the old post of mine. This is the code after suggestions were implemented in the review. Do you think I could make ...
6
votes
2answers
538 views
10
votes
1answer
173 views

SQL Tic-Tac-Toe attempt

In an attempt to practice conditional statements in SQL I decided to design a tic-tac-toe game with MySQL. Let me know if you think any of the steps could be done better. Step 1: Create the game ...
2
votes
2answers
130 views

SQL Injection when not using variables

Do I still need to protect my code against SQL injection when I'm not using variables in SQL queries? Is this code still vulnerable?: ...
2
votes
1answer
116 views

SQL injection security

I wanted to know if this code is safe against SQL injection or not? Also do I need to mysqli_close if I already did the ...
2
votes
0answers
82 views

Pagination object oriented

This a little pagination script that I am writing "Object Oriented" and I have no idea how to set the current page equal to total page, if the current page is greater. I also would really like it if ...
4
votes
1answer
59 views

Blog engine or somesuch

Would someone tell how I can improve this piece of code? ...
7
votes
2answers
137 views

Modifying `sakila` database

This is not "real life" code. I'm trying to expand upon the well known Sakila sample database for MySQL to make it more complex. Step 7 (or 6) is running ...
7
votes
2answers
120 views

How is my injection protection?

What do I need to do to prevent injections? In addition, if I have any statement/parameter errors, please tell me. ...
1
vote
2answers
262 views

MySQLi-extension class (parameterized queries)

I've written some code today to be able to dynamically execute prepared statements/parameterized queries. I need a fresh pair of eyes to look through my code for eventual performance gains that can ...
6
votes
3answers
5k views

First PHP login system

This is my first attempt at a login system! I've only had roughly 2 days of experience with MySQL and PHP so far and this is what I came up with: ...
8
votes
1answer
141 views

Optimize web-scraping of Moscow grocery website

This code works fine, but I believe it has optimization problems. Please review this. Also, please keep in mind that it stops after each iteration of the loop ...
4
votes
1answer
102 views

Selecting one MySQL date with month reduced by one

I was thinking in a way to improve the following query if possible: ...
2
votes
2answers
69 views

Abusive use of long database query?

I somehow acquired the idea that I should reduce the number of trips to the database as much as possible and so I use a lot of very long queries. For example, I had a function that does this: ...
3
votes
3answers
97 views

Inline PHP IP access log

For a website, I've got some inline PHP, posted below. It's supposed to log traffic to the website, and it does its job fine. But at the end of the day, I'm not even close to a PHP developer, and ...
3
votes
2answers
104 views

Is there a “prettier” way of forming this query, or a more efficient way of joining the tables?

Yesterday I posted a question involving multiple nested queries. The queries pulled information from the database and created a directory listing of all employees. There are two many-to-many ...
0
votes
1answer
117 views

Would multiple joins boost performance, or are the nested queries an acceptable way to handle the situation?

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 ...
6
votes
2answers
608 views

My database class extends MySQLi

The following is a small class I extended MySQLi with. I'm going to use this in my upcoming projects, but my main reason to do this class is learning, so I would like to submit this for your review, ...
13
votes
3answers
308 views

Prepared statements from security viewpoint

I've decided to go with OOP style and prepared statements, and so far I like it a lot more than the procedural style. It's much more understandable in my opinion. For this code review, I've just ...
3
votes
1answer
124 views

UPDATE SQL with prepared stmt using only 1 variable

HTML form field names must be equal to SQL table field names. Changing only table name and allowed fields can be used in many other update pages. How can I improve this? ...
5
votes
1answer
153 views

Arithmetic quiz using PHP5 and mySQLi

I would very much appreciate a general review of my PHP code which grabs information from a mySQL database and also inserts some information into the database. Overview : Users go to /main.php and ...