Git Product home page Git Product logo

php-libmysqldriver's People

Contributors

victorwesterlund avatar

Watchers

 avatar

php-libmysqldriver's Issues

Passing empty array to `run_query()` throws an error

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') LIMIT 1' at line 1

This is caused by run_query() only checking if the value for $param is null, not if it's empty.

"SELECT NULL FROM <table> WHERE () LIMIT 1"

Make `flatten()` run `limit(1)`

I'm considering making the MySQL->flatten() method also run MySQL->limit(1) since it has the same effect.

Example:

// Flatten returned array to first entity if set
public function flatten(bool $flag = true): self {
	$this->flatten = $flag;

	// Set LIMIT 1 if flatten flag is enabled, or unset if turned off
	$this->limit($this->flatten ? 1 : null);

	return $this;
}

I'm not sure tho if this could have other unwanted side-effects when for example removing the flatten flag with flatten(false). LIMIT would still be 1. Or if we simply remove the LIMIT all together, any LIMIT set before this will be forgotten and wiped and I'm not sure either if it's worth storing the last LIMIT in an instanced property.. It might be overkill.

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.