Snippets tagged “mysqli”
31 snippets use this tag.
- Codeigniter: fatal error call to undefined function mysqli_init()PHP
Here's an example of how the error might appear in a Codeigniter application:
- Commands out of sync; you can't run this command nowPHP
The "Commands out of sync; you can't run this command now" error in PHP usually occurs when you have called a MySQL function in an incorrect order.
- error in your SQL syntax; check the manual that corresponds to your MySQL serverPHP
This error message is indicating that there is a problem with the SQL syntax used in the query.
- Example of how to use bind_result vs get_resultPHP
The mysqli_stmt::bind_result() method binds variables to a prepared statement for result storage.
- Executing multiple SQL queries in one statement with PHPPHP
In PHP, you can execute multiple SQL queries in one statement by using the mysqli_multi_query() function.
- Export MySQL database using PHPPHP
To export a MySQL database using PHP, you can use the mysqldump command-line utility or the mysqli extension.
- Fatal error: Call to undefined function mysqli_connect()PHP
The "Fatal error: Call to undefined function mysqli_connect()" error in PHP typically occurs when the MySQLi extension is not enabled or properly configured in your PHP environment.
- get array of rows with mysqli resultPHP
You can use the mysqli_fetch_assoc() function to retrieve an associative array of a single row from a result set, and use a loop to iterate through the result set and store each row in an array.
- Get Category name from Post IDPHP
To get the category name from a post ID in PHP, you can follow these steps:
- Getting ’ instead of an apostrophe(') in PHPPHP
This can occur if your PHP code is using the ISO-8859-1 character set instead of UTF-8.
- How can I enable the MySQLi extension in PHP 7?PHP
To enable the MySQLi extension in PHP 7, you need to follow these steps.
- How do I display a MySQL error in PHP for a long query that depends on the user input?PHP
To display a MySQL error in PHP for a long query that depends on user input, you can use the mysqli_error() function.
- How to access mysql result set data with a foreach loopPHP
To access MySQL result set data with a foreach loop, you can use a loop like the following:
- How to Check if a Record Exists in a MySQL DatabasePHP
In this tutorial, we are going to represent to you two handy options of how to check if a record exists in the database with PHP.
- How to Convert MySQL Data to JSON with PHPPHP
If you wonder how to find a proper way of converting MySQL data to JSON format using PHP, then you are in the right place. Read on and check the example.
- How to get primary key of table?PHP
To get the primary key of a table in PHP, you can use the SHOW KEYS SQL statement to retrieve information about the keys (including the primary key) of a table.
- How to install MySQLi on MacOSPHP
To install MySQLi on a Mac, you will first need to install the MySQL database server on your machine.
- Increment value in MySQL update queryPHP
To increment a value in a MySQL update query using PHP, you can use the += operator.
- mysql_fetch_array() expects parameter 1 to be resourcePHP
It looks like you are trying to use a function from the MySQL extension in PHP, but you are getting an error saying that the first parameter should be a resource.
- mysqli or PDO - what are the pros and cons?PHP
mysqli and PDO are both PHP extensions used for interacting with databases.
- mysqli_connect(): (HY000/2002): No connection could be madePHP
This error message typically indicates that there was a problem trying to establish a connection to the MySQL server.
- mysqli::query(): Couldn't fetch mysqliPHP
This error message is typically encountered when an attempt to execute a MySQLi query has failed.
- PHP MYSQL UPDATE if Exist or INSERT if not?PHP
You can use the ON DUPLICATE KEY UPDATE statement in your MySQL query when using PHP's mysqli or PDO libraries to accomplish this.
- PHP/MySQL insert row then get 'id'PHP
To insert a row into a MySQL database table and get the id of the inserted row in PHP, you can use the mysqli_insert_id() function.
- php/mySQL on XAMPP: password for phpMyAdmin and mysql_connect different?PHP
The password for accessing phpMyAdmin and the password for connecting to the MySQL server using the mysql_connect() function can be different.
- Populate a Drop down box from a mySQL table in PHPPHP
You can use the PHP MySQLi extension to connect to a MySQL database and retrieve the data from a table to populate a drop-down box.
- Save PHP array to MySQL?PHP
To save a PHP array to a MySQL database, you can use the serialize() function to convert the array into a string, and then use an INSERT or UPDATE statement to save the string into a TEXT or LONGTEXT field in the database.
- Send html form data to sql database via php (using mysqli)PHP
To send HTML form data to a SQL database using PHP, you will need to use the mysqli (MySQL Improved) extension in PHP.
- The mysql extension is deprecated and will be removed in the future: use mysqli or PDO insteadPHP
It is true that the MySQL extension is deprecated, and it is recommended to use either MySQLi or PDO instead.
- Warning: mysqli_connect(): (HY000/2002): No such file or directoryPHP
This error message is indicating that there is a problem connecting to the MySQL server.
- Why shouldn't I use mysql_* functions in PHP?PHP
The mysql_* functions in PHP are deprecated, meaning that they are no longer recommended for use and will likely be removed in a future version of PHP.