Giter VIP home page Giter VIP logo

php-mysql-mysqli-wrapper's Introduction

MySQL wrapper for MySQLi

This collection of MySQL functions is trying to be a drop in replacement for the PHP MySQL extension. In PHP 5.5 the MySQL extension is deprectated and triggers errors. This package is trying to support legacy projects without the need of having the MySQL extension installed by using this package you are not hold back to update to new PHP versions.

The return values of my functions are aimed to match the native MySQL functions as close as possible.

php-mysql-mysqli-wrapper's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-mysql-mysqli-wrapper's Issues

mysql_fetch_array result incorrect result

mysqli_fetch_array returns NULL when there are no more results, but mysql_fetch_array returned FALSE. To fix, change line 249 from return mysqli_fetch_array($result, $result_type); to return mysqli_fetch_array($result, $result_type) ?? FALSE;

mysql_fetch_field if $field_offset == 0

check this changes

if $field_offset== 0
mysqli_field_seek is not call and
mysqli_fetch_field fail

function mysql_fetch_field(mysqli_result $result, $field_offset = -1)
{
		if ($field_offset>=0) {
			mysqli_field_seek($result, $field_offset);
		}

        $foo = mysqli_fetch_field($result);

        // increase mysql_fetch_field compatibility ;-)
        if ($foo->flags & 2) $foo->primary_key = 1;
        if ($foo->flags & 4) $foo->unique_key = 1;

	return $foo;
}

1 passed to mysql_free_result() must be an instance of mysqli_result, boolean given

Whole Error:

Fatal error: Uncaught TypeError: Argument 1 passed to mysql_free_result() must be an instance of mysqli_result, boolean given, called in /home/httpd/[...]/functions.php on line 478 and defined in /home/httpd/[...]/mysql.php:284 Stack trace: #0 /home/httpd/[...]/functions.php(478): mysql_free_result(true) #1 /home/httpd/[...]/chat.php(25): aktualisiere_online('43', '19', 0) #2 {main} thrown in /home/httpd/[...]/mysql.php on line 284

since the site is in german: "aktualisiere_online" means "update_online"

I've been using the wrapper for our chat and if I just simply delete the line in the "function" script encountering in the error there is no error anymore, but I also can't type anything in the chat despite it running smoothly and looking all good otherwise. Now the not-being-able-to-type-issue could be somewhere else but I can't rule it out with this error.
The line given in my "functions" script:
@mysql_free_result($result); - Line 478

The line given in my "chat" script:
aktualisiere_online($u_id,$o_raum,0); -Line 25

referring to this line from mysql.php
mysqli_free_result($result); - Line 284

I have no understanding of php what so ever (the little things I know is from like 10 lessons of learning C# - 10 years ago in university), I know more or less how scripts work together but I really only need the wrapper to bypass the time till I find someone to re-write the whole chat. So if there is any solution to this I'd appreciate it if someone would explain it to me like they'd explain it to a toddler :(

global variable?!?

using a global variable $link exposes to the risk of overwriting/being it overwritten by an identical app variable.

$link should at least be renamed to something weird, e.g. $myyyyyyyLink in order to avoid the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.