search
HomeBackend DevelopmentPHP TutorialWhat process is qqexternal.exe? ezSQL PHP database operation class library

ezSQL download address:
Download: ezSQL
The new version is 2.05, which adds a lot of support, including CodeIgniter, MSSQL, PDO, etc.
I have also written for CodeIgniter once before, but it only supports MySQL
Look at the usage examples
In fact, it is not difficult , just look at the source code, mainly because the programming ideas are very good.
Example 1
------------------------------------------------- ------
// Select multiple records from the database and print them out..
$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user ) {
// Access data using object syntax
echo $user->name;
echo $user->email;
}
Example 2
---------------- ------------------------------------
// Get one row from the database and print it out. .
$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");
echo $user->name;
echo $user->email;
Example 3
-- --------------------------------------------------
// Get one variable from the database and print it out..
$var = $db->get_var("SELECT count(*) FROM users");
echo $var;
Example 4
---- ---------------------------------------------
/ / Insert into the database
$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'justin','jv@foo.com')");
Example 5
--- --------------------------------------------------
// Update the database
$db->query("UPDATE users SET name = 'Justin' WHERE id = 2)");
Example 6
---------------- ------------------------------------
// Display last query and all associated results
$db- >debug();
Example 7
---------------------------------------- ------------
// Display the structure and contents of any result(s) .. or any variable
$results = $db->get_results("SELECT name, email FROM users" );
$db->vardump($results);
Example 8
-------------------------------- --------------------
// Get 'one column' (based on column index) and print it out..
$names = $db->get_col ("SELECT name,email FROM users",0)
foreach ( $names as $name ) {
echo $name;
}
Example 9
----------------- ----------------------------------
// Same as above 'but quicker'
foreach ( $db ->get_col("SELECT name,email FROM users",0) as $name ) {
echo $name;
}
Example 10
------------------ ----------------------------------
// Map out the full schema of any given database and print it out ..
$db->select("my_database");
foreach ( $db->get_col("SHOW TABLES",0) as $table_name ) {
$db->debug();
$db ->get_results("DESC $table_name");
}
$db->debug();
EZSQL class introduction:
ezsql is a small and fast database operation class that allows you to easily operate with PHP Various databases (MySQL, oracle8/9, interbase, FireBird, PostgreSQL, MS-SQL, sqlite, sqlite C++).
Include a PHP file at the beginning of your script. You can then use a smaller, easier set of ezsql functions in place of the standard PHP database functions.
It automatically caches query results, provides a series of simple function operations and extensions, and does not cause additional server overhead.
It has excellent debugging functions, allowing you to quickly judge the execution process of SQL statements. ezsql function can return The result is an object, associative array, or numeric array
It can greatly shorten development time, and in most cases, will simplify your code, make it run faster, and make it easy to debug and optimize your database query statements .
This is a small category that doesn’t add a lot of overhead to your website.
The following methods are included in the class:
- $db->get_results – Read a data set from the database (or previously cached data set)
- $db->get_row – Read a piece of data from the database (or Previously cached data)
- $db->get_col – Read a column of the specified data set from the database (or previously cached data set)
- $db->get_var — Read a value from the database data set (or Previously cached data)
- $db->query - execute a sql statement (if there is data, cache it)
- $db->debug - print the last executed sql statement and the returned result (if there is a result )
- $db->vardump – Print the structure and content of variables
- $db->select – Select a new database
- $db->get_col_info – Get column information
- $db->donation – Donate money to the author
- $db->escape – Format the string inserted into the database, eg: mysql_escape_string(stripslashes($str))
- $db->flush – Clear the cache
- $db- >get_cache – exchange cache
- $db->hide_errors – hide errors
- $db->register_error – register errors
- $db->show_errors – show errors
- $db->store_cache – store to Cache
- $db->sysdate – Get the system time
- $db = new db — Create a new db object.
Wordpress has modified ezsql, and also made it only applicable to mysql
Some classes modified by wordpress The operation is the function as follows:
function query($query)
This function is the most basic function of WPDB. $query is a SQL statement, which is submitted to the database query. The results are divided into two situations:
1. If it is "insert|delete| update|replace", returns the number of affected rows, in the case of "insert|replace", use $this->insert_id to record the newly inserted ID.
2. If it is "select", use $this->last_result to record the query result set and return the number of rows of records found.
function escape($string)
Use backslashes to quote strings, that is, use magic quotes.
function insert($table, $data)
This is the insert record function. The first parameter is the field array of the table, and the second is the data array. Returns 1 when inserting data, 0 otherwise.
function update($table, $data, $where)
This is the update record function. The first parameter is the field array of the table, the second is the data array, and the third is the condition array, which is a nane array. It is 1 if updated, 0 otherwise.
function get_var($query=null, $x = 0, $y = 0)
If $query is not empty, first execute the query and then return the value of column X and row Y.
function get_row($query = null, $output = OBJECT, $y = 0)
Returns a row, $outpu specifies the return type, which can be ARRAY_A, ARRAY_N or OBJECT. $y specifies the row number.
function get_col($query = null, $x = 0)
Returns a column, $x specifies the column.
function get_results($query = null, $output = OBJECT)
Returns the query result set, which can be returned in three ways: ARRAY_A, ARRAY_N or OBJECT.
function get_col_info($info_type = ‘name’, $col_offset = -1)
Return field information.
There are some other functions, which I won’t go into details here. There are also two global variables, SAVEQUERIES and WP_DEBUG. The first one allows you to save the queries executed by the accessed page into the $this->queries array for later use in debugging. WP_DEBUG allows you to save the queries executed by the visited page. Error output. Both of these are not turned on by default. You can turn them on in wp_config.php when testing.

The above introduces what process qqexternal.exe is and the ezSQL PHP database operation class library, including what process qqexternal.exe is. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the difference between unset() and session_destroy()?What is the difference between unset() and session_destroy()?May 04, 2025 am 12:19 AM

Thedifferencebetweenunset()andsession_destroy()isthatunset()clearsspecificsessionvariableswhilekeepingthesessionactive,whereassession_destroy()terminatestheentiresession.1)Useunset()toremovespecificsessionvariableswithoutaffectingthesession'soveralls

What is sticky sessions (session affinity) in the context of load balancing?What is sticky sessions (session affinity) in the context of load balancing?May 04, 2025 am 12:16 AM

Stickysessionsensureuserrequestsareroutedtothesameserverforsessiondataconsistency.1)SessionIdentificationassignsuserstoserversusingcookiesorURLmodifications.2)ConsistentRoutingdirectssubsequentrequeststothesameserver.3)LoadBalancingdistributesnewuser

What are the different session save handlers available in PHP?What are the different session save handlers available in PHP?May 04, 2025 am 12:14 AM

PHPoffersvarioussessionsavehandlers:1)Files:Default,simplebutmaybottleneckonhigh-trafficsites.2)Memcached:High-performance,idealforspeed-criticalapplications.3)Redis:SimilartoMemcached,withaddedpersistence.4)Databases:Offerscontrol,usefulforintegrati

What is a session in PHP, and why are they used?What is a session in PHP, and why are they used?May 04, 2025 am 12:12 AM

Session in PHP is a mechanism for saving user data on the server side to maintain state between multiple requests. Specifically, 1) the session is started by the session_start() function, and data is stored and read through the $_SESSION super global array; 2) the session data is stored in the server's temporary files by default, but can be optimized through database or memory storage; 3) the session can be used to realize user login status tracking and shopping cart management functions; 4) Pay attention to the secure transmission and performance optimization of the session to ensure the security and efficiency of the application.

Explain the lifecycle of a PHP session.Explain the lifecycle of a PHP session.May 04, 2025 am 12:04 AM

PHPsessionsstartwithsession_start(),whichgeneratesauniqueIDandcreatesaserverfile;theypersistacrossrequestsandcanbemanuallyendedwithsession_destroy().1)Sessionsbeginwhensession_start()iscalled,creatingauniqueIDandserverfile.2)Theycontinueasdataisloade

What is the difference between absolute and idle session timeouts?What is the difference between absolute and idle session timeouts?May 03, 2025 am 12:21 AM

Absolute session timeout starts at the time of session creation, while an idle session timeout starts at the time of user's no operation. Absolute session timeout is suitable for scenarios where strict control of the session life cycle is required, such as financial applications; idle session timeout is suitable for applications that want users to keep their session active for a long time, such as social media.

What steps would you take if sessions aren't working on your server?What steps would you take if sessions aren't working on your server?May 03, 2025 am 12:19 AM

The server session failure can be solved through the following steps: 1. Check the server configuration to ensure that the session is set correctly. 2. Verify client cookies, confirm that the browser supports it and send it correctly. 3. Check session storage services, such as Redis, to ensure that they are running normally. 4. Review the application code to ensure the correct session logic. Through these steps, conversation problems can be effectively diagnosed and repaired and user experience can be improved.

What is the significance of the session_start() function?What is the significance of the session_start() function?May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment