Coder Social home page Coder Social logo

pdo_class_wrapper's Introduction

Hi there ๐Ÿ‘‹

Greetings, I'm Neeraj Singh, known by the aliases Noncent and Nono. My journey in the realm of technology is fueled by a fervent dedication to open-source collaboration and an insatiable curiosity for emerging innovations.

As an enthusiast committed to the spirit of contribution, I revel in the dynamic world of GitHub and Stack Overflow, platforms where I share my endeavors and engage with a vibrant community.

Among my recent accomplishments, I take pride in the development of the Instagram Data Scraper, a PHP-based script designed to extract user and hashtag-related data from Instagram. This project reflects my commitment to creating tools that not only serve a practical purpose but also resonate with the broader technological landscape.

My technological odyssey extends beyond individual projects, encompassing a diverse array of interests and proficiencies. From navigating the intricacies of AWS to harnessing the potential of Node.js, JavaScript, Dialogflow, Alexa Skills, Laravel, CodeIgniter, and Go, I derive genuine pleasure from the artistry of crafting innovative solutions.

Join me on this ever-evolving journey, where the pursuit of knowledge and the joy of creation converge in a harmonious dance of code and creativity.

pdo_class_wrapper's People

Contributors

neerajkumarsingh avatar noncent avatar rumplin avatar

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

Watchers

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

pdo_class_wrapper's Issues

Insert issue

Issue while inserting row with insert()
I have counted it has enough matching parameter though it shows mismatch error

Executed Query -> INSERT INTO table (user_id,title,description,address,latitude,longitude,property_id,outdoor_size,late_bookings,cancellation_policy,created_date) VALUES (2,"poodles r us","poodles r us makes u dog happy! NO kennels, just friendly people TO look AFTER your dog WHILE you re away! think OF us friends","slough, slough, slough sl3 8ay, uk",51.5006615,-0.5303367,6,"medium",1,1,"2014-08-19 22:36:23");
ERROR:"SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: 480"

Do you have the latest version for PHP7 ?

Hi, I found your wrapper class helpful and so wanted to use it. but before I start using it, Is there any latest version of the wrapper class available with you ?

I also read that new version coming soon in the introduction page but looks like this repo is not updated since last few years..

let me know if I can wait few days for latest version ?

Thanks

how can you compare array against string function

See line no near 389: if(strstr(key($aWhere), ' ')){

$aWhere is array how can you compare with string function. this issue is present throughout class in all functions.

And if you add operators like '>' in array('field >'=>$val) will return an error

SQLSTATE[08004] [1040] Too many connections

When you use this class in a while or for loop, you will get errors
ERROR in establish connection: SQLSTATE[08004] [1040] Too many connections

which indicates, that this class does not reuse connections, but instead opens always a new connection?

SQL IN operator

Is it possible something like this, with IN operator:
SELECT * FROM Customers WHERE City IN ('Paris','London');
Thanks

Update query is not executing

Hi

I am using you pdo wrapper. I am having problem in updating sql query. I am not getting any error but the query is not updating

$pObjDB->update('usertable', array('username' => $newuser, 'password' => $passwordMD5, 'acctype' => 0), array('username' => $username), 'LIMIT 1')->affectedRows();

I am not able to understand what I am doing wrong, but the same query is running successfully in command prompt.

UPDATE usertable SET username = "test12", password = "81dc9bdb52d04dc20036dbd8313ed055", acctype = 0 WHERE username = "test" LIMIT 1;

Could please help me out

[Question] Update incremental value

Hello,

how would I use the update method for incremental values?

example:
UPDATE table SET value = value +1 WHERE id = 1;

This doesn't work as expected:
$db->update("table", array("value "=>"value + 1"), array("id"=>(int)$id));

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'value + 1' for column 'value' at row 1: update - table: 711

wild cards?

When passing a wildcard to select, it produces an error. For example:

$q = $db->select('Wells', '', array('Name LIKE '=>'%anderson%'))->results();

With PDO, execute(array(':Name'=> '%anderson%')) will return a wild card match. I went through the class quickly to find why this was happening, but didn't spot it.

Connect through unix_socket

Thanks for this great Class! But one think...
There's now way to connect an Server through unix_socket- but big Hoster like 1and1 prefer a connection through socket.
My Workaround:

try {
    // use native pdo class and connect
    //if connection via socket
    if (isset($dsn['socket'])) {
        parent::__construct("mysql:unix_socket=$socket;dbname=$dbname", $username, $password, array(
            PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
        ));
    } else {
        //Normal connection
        parent::__construct("mysql:host=$host; dbname=$dbname", $username, $password, array(
            PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
        ));
    }
}

--> If an Parameter 'socket' is given via db config, the class connect through unix_socket... quick'n'easy, yeah, but it works :-)

[Feature request] Add more description to debug problems

Hello,

please enhance the self::error calls, to add more details.

I had multiple pdoQuery calls, but I didn't know in which call I have an error.
So I changed the pdoQuery method to help me out:

 } catch (PDOException $e) {
        self::error($e->getMessage() . ': ' . __LINE__ . ". SQL: " . $sSql);
 } // end try catch block

Would even help more if I knew where in my original script I had the error - filename and line. Maybe something that can be achieved with $_SERVER["SCRIPT_FILENAME"]

PHP8 Compatibility

Im getting an error in PHP 8 General error: 2014 Cannot execute queries while other unbuffered queries are active, trying to run this query:

			  $db->pdoQuery("
			  UPDATE sites
			  SET users = CASE
				 WHEN users = 0 THEN 1
				 ELSE CONCAT(users, ',1')
			  END
			  WHERE id = "  3
			  )->results();

It works fin in PHP 7+

how to write a delete query

Hi Admin

I have a delete query not able to execute using the class.
Here is my query, please let me know how to execute

DELETE FROM students WHERE studentID IN (1,2,3,4,5)

Regards
Narasimha

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.