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

5
votes
1answer
36 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
531 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
491 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. ...
3
votes
2answers
164 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
113 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
40 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 ...
7
votes
2answers
101 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 ...
5
votes
2answers
196 views
9
votes
1answer
87 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
122 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
111 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
53 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
48 views

Blog engine or somesuch

Would someone tell how I can improve this piece of code? ...
6
votes
2answers
78 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
102 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
112 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
1k 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: ...
1
vote
0answers
58 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
76 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
62 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
84 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
89 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
60 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
131 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
245 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
78 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? ...
4
votes
1answer
99 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 ...
2
votes
2answers
92 views

Workaround for have 2 column with pseudo AUTO INCREMENT

This is the situation : the table order has a column with ID AUTO INCREMENT but (there is always a but) i can't use it because i don't want number order 1234567 after 5 years but i want 1/2014 , ...
3
votes
1answer
39 views

Are all these steps necessary with prepared statement?

Are all these steps correct and necessary? ...
4
votes
2answers
92 views

Does this generic query follow good OOP standards?

I am trying to convert over to MySQLi and wanted expert advice. Is the enclosed code 100% OOP. Also, how secure is the code against attacks? I know nothing is 100% secure, but how good/safe is it? ...
5
votes
2answers
380 views

Update PHP function GetSQLValueString

The old function was: ...
4
votes
1answer
117 views

Help me shorten my URL shortener

I am working on a website, and due to some reasons, they want my code to be as short as possible. I have, from my side, tried everything to shorten this code. So if possible, can you all also help me ...
3
votes
1answer
145 views

Increase security of sign up form code

Does my PHP look secure enough for a sign up form? ...
0
votes
2answers
787 views

PHP starting OOP MySQLi singleton

this is my first post on the whole StackExchange network, so I might make some mistakes. And I'm also spanish spearker, so I'll probably have mistakes in my writting too.. Context: I'm starting with ...
2
votes
2answers
81 views

Critiques and possible improvements for this DB abstraction class

I'm trying to code a simple and scalable PHP framework for my own use. Could you please offer some critiques or mandatory improvements for these 2 classes? ...
3
votes
1answer
1k views

PHP Register Page ( MYSQLI )

I have a website written in PHP but the whole script is old so today I started upgrading from Mysql to Mysqli. So here's my register page. I still have to add account confirmation and send mail part ...
1
vote
1answer
41 views

How could I simplify this query?

How can this function be better? I feel there might be a more elegant way of doing it. For a little background on the function. I am trying to evaluate if someone has read and seen all the questions ...
3
votes
2answers
557 views

Some questions about correct use of Mysqli (Connection, query)

I'm beginner PHP developer and it's my first time using mysqli. I've no idea about if i use a correct implementation of the connection and query because some people defend this method and some others ...
6
votes
2answers
563 views

Minimalistic mysql db class

I am really just looking to make sure I am not making any weird mistakes that could hurt me in the long run or if something seems odd in the way I imagine it to work. This code does work for the way I ...
1
vote
1answer
197 views

How can I make this code safer against XSS attacks?

I'm not sure what I'm doing wrong, but I run the code using a Web Vulnerability software and I get a lot of XSS attacks against the code. Is there something I could do better? ...
-3
votes
1answer
149 views

A short MySQLi library that should solve SQL injection risks. Feedback? [closed]

I keep seeing SQL injection ready code posted on SO and I just can't believe people don't escape they SQL input variables. It should become a reflex but nobody's doing it. So... I decided to share a ...
0
votes
1answer
114 views

Need a review on how I ran my MYSQL Queries

I was hoping there is a better way to accomplish the same thing I have here without 24 queries. I have two queries for each ...
2
votes
1answer
82 views

User Data Security

I'm working on my site, and need help knowing what I need to do to improve the security of my login system. If you feel so inclined, I would love some help to tell me what the exact changes that I ...
1
vote
2answers
85 views

MySQLi Code Review for methods and functions used

I made my first script of MySQLi. I have just learnt it from 3rd party website. So, I am not sure i am using functions which are not deprecated or outdated. I should start to practice good scripts to ...
2
votes
1answer
150 views

Could really use some feedback on this registration code in php

I was hoping someone could give me some feedback on my code. I am still new to php and I'm sure I have messed up somewhere. The code pasted is for a registration page where users will submit their ...
0
votes
1answer
57 views

Is declaring a property as `public` insecure?

I posted a question few weeks back, on making a PHP Login Script. Most of you guys told me not to use global variables and especially for something like MySQLi ...
3
votes
3answers
152 views

Improve Speed of RPI Calculation

It currently takes about 10 minutes to process ~16k teams and ~81k games. I could soon have ~17k teams with ~160k, and multiple sports. I run this as a cron job overnight and store the results in a ...
1
vote
2answers
163 views

Prepared Statements Function

Hello, CR :) I've finally finished my universal query preparation function. Sorry about my previous post, I wasn't aware of the rules before. Anyway, here is a working function. Any suggestions to ...
0
votes
1answer
76 views

(Procedural)(Snippet) MySQL to MySQLi. Any advice?

This is what i had before (using the MySQL api) ...
3
votes
2answers
177 views

Can this class be improved?

I have this class whose code I pasted in full. The CredentialsManager class is not shown here as all it does is return the DB connection variables. My question is ...