I am trying to register customers for a continuing education web site I am creating and need to add multiple entries to the phpMyAdmin table “users” for registration purposes. I am trying to add multiple entries, 25 total. As you will see, I have tried the mysqli_multi_query() function to add them all but I cannot create a new record of
Tag: mysqli
How safe is to use mysqli_insert_id() and if not what should I use?
I have a very simple question I want to know the id of the last query that I inserted in my MySql DB. It’s safe and efficient to use mysqli_insert_id() and if not what should I use? Answer Yes, it’s the recommended way to retrieve an ID value generated by an insert when using auto-increment. But it has limitations, which
How to redirect PHP page on MySQL database connection failure
Using MySQLi connection method I am trying to redirect page instead of printing out the error message trying to test this out I change the localhost to localhostszzz but I am getting error message of Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /../../page.php on line 8 Instead of re-directing to http://www.example.com/, how can I fix this?
Setting up a web application using MySQL
I’m new to setting up a web based application. I have a server with MySQL setup with a database. The site is running my login web page. Currently I have users setup using MyPhpAdmin which will quickly prove burdensome. More importantly, once I run the command “$connection = mysqli_connect(‘1.2.3.4’, $username, $password, ‘databasename’);”, the variable $connection does not continue to exist
Why I can’t connect to a MySQL 5.3.36 shared server using mysqli_connect and PHP 7.4, but it will work using php 7.1?
I have this shared account on Hostgator. Using PHP 7.1 and mysqli_connect, I have no issue connecting to the MySQL 5.3.36 database. The PHP script should be fine. The hosting company sent me an email …
How to fetch indices and names from the MySQL database?
I’m working on a website and it has a category dropdown. So my database has tabled called “category”, and it has four items in there: And I’m trying to get all this info into an array, so I can use it in my HTML. But I’m getting a conversion error when I try this: The error I’m getting is: Line
What is the difference between mysqli::connect and new mysqli?
Mysqli library offers a number of alternative syntaxes for establishing connection to the MySQL server. #1 $mysqli = new mysqli(‘localhost’, ‘my_user’, ‘my_password’, ‘my_db’); # 2 $mysqli = new …
PHP mysqli and SSL
I am trying to configure Galera Cluster over a WAN (VPN is not an option). For obvious reasons I am setting up the connections to require SSL keys, and am having difficulties getting the application …
How to fix “Array to string conversion” to display content from table as a checkbox description
I am creating a table with content fed from a table in a MySQL Database. One of the fields on the table is a checkbox form that adds roles to the user. I got it to work, but with the description being hardcoded. Since a new role might get added, I want to show it as a new checkbox option.
How can I use mysqli to SELECT and both DELETE and RETURN a single row based on WHERE condition
How can I do a mysqli php query so a SELECT request both RETURNS the row AND DELETES the same row in the MySQL DB? This php script works fine to query and return a single row based on max numerical zipcode (an example) but my modifications do not complete the delete row: I tried adding this line in various