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

-4
votes
0answers
18 views

why my php/mysqli code doesn't work? [closed]

I have written this code for check user data exist in db : $username = $_POST['username']; $email = $_POST['email']; $mobile = $_POST['mobile']; $SQL = "SELECT ...
1
vote
2answers
30 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
81 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
47 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 connection object as it may be insecure. ...
1
vote
2answers
84 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
70 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
45 views

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

This is what i had before (using the MySQL api) $info_get = mysqli_query("SELECT * FROM `users` WHERE `uid`='".$_SESSION['uid']."'") or die(mysqli_error()); $info = mysql_fetch_assoc($info_get); ...
3
votes
2answers
136 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 if this class can be improved or if ...
3
votes
1answer
753 views

Better way of handling data returned from fetch_assoc() (mysqli)

So I connected to the db, pull the data using fetch_assoc() (fetch_all(NUMB) is not available on the machine we are working with else this would be less of an issue). So I get the returned data and ...
3
votes
1answer
552 views

mysqli wrapper class

I made the following class to wrap mysqli for PHP using prepared statements. It seems to work well, but I was hoping to get opinions (on overall structure, performance, usage, etc.). Thanks for the ...
3
votes
2answers
170 views

Best practices to protect a database from bad data

I'm just getting into SQL injection and data sanitization and seeking some advice on my script to get started. I have made this simple program which allows the user to enter their name into a form and ...
5
votes
1answer
315 views

MySQLi DB library - quality/security review?

This libray was written quite some time ago, and it has so far been used in all sorts of small-ish projects. I'm about to base a more complex, security (Access Control) related, open-source project ...
1
vote
1answer
128 views

Extracting Multiple Associative arrays in PHP

public static function find_user_tracks($id) { global $mySQL; $sql = "SELECT * FROM `tracks` WHERE account_id = {$id}"; $result_set = $mySQL->query($sql); $ret = array(); ...
3
votes
1answer
520 views

Creating a database class in PHP with MySQLi

I am creating a database class in PHP but I feel that there's something wrong with my code. Is there any suggestion to refactor this? I feel like there's something wrong and missing in this code. ...
2
votes
2answers
69 views

Inserting data in the database through POST

My code here is completely working, but I feel like I destroyed or didn't follow the DRY rule, what suggestions can you give to me for this code?? <?php require_once("./includes/Utilities.php") ...
2
votes
2answers
86 views

Username verification class

Everything in this code is completely working, but I still feel that this code needs to be refactored. any suggestions? <?php class Db_CheckUsername{ protected $_conn; ...
2
votes
2answers
498 views

PHP-Mysqli example secure?

I'm just writing my first PHP-Mysqli sample (think about a Wiki 0.0.1) and I would like to ask you if this example is secure or not or if there are any other problems/suggestions you might recommend? ...
4
votes
2answers
180 views

Am I on the right track? PHP/MySQL

I have the following table called info: info_name | info_value name | Susan desc | Human I'm trying to print Susan without knowing that the value is Susan. The following ...
2
votes
1answer
126 views

Another how could this mysqli php call be better

This code from a flex app and is the PHP to set that a user has read a section of text and answered a question correctly. So I write to a table that is similar to a bookmark, and then update the users ...
1
vote
1answer
260 views

How could this PHP function / mysqli call be better?

I just wanted to post my php code to see how it could be better. It works fine, but I feel that since I am new to this, it probably isn't best. For some background on the code, it is from a flex app ...
1
vote
2answers
206 views

Need Tips For Improving PHP Code

I am fairly new to PHP, and would love to have my code reviewed to see what I am doing wrong and ways to improve it. The code works fine, I just feel like there's an easier way to do this. This is ...
2
votes
1answer
273 views

MySQLi_STMT wrapper, allows placeholders

I've made a simple wrapper for MySQLi_STMT, allowing the usage of placeholders and spares you the need to manually bind variables. The full code is at the bottom of this question (it's quite large, ...
6
votes
1answer
348 views

MySQLi_Recordset: blending SPL and Statement/Query results

I've made a SPL-based class named "Recordset" that wraps both MySQLi_STMT and MySQLi_Result objects and allows treating either as a 3-dimensional array. It requires PHP5.3+. I'm pretty bummed about ...