Here is the code I am not sure what is going on as I am sure i made no errors while typing. As it keeps showing me that there is an unknown database despite the fact i made a CREATE DATABASE statement. I do not know if there is something else i need to do but by all measures the
Tag: mysqli
Data from 2 tables is not displaying on the same page
I’m a newbie in PHP and mySQL, I’m currently working on a profile page where I will display the logged in user’s personal information from one table called users and also display the tours that they will book in the future from my website from this table: booking I’m fetching the data from users table with prepared statement which will
PHP (v5.6) Error Uncaught exception ‘mysqli_sql_exception’ with message ‘Access denied for user [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 year ago. Improve this question
How to write multiple queries in a single tables.sql file and upload it using PHP?
All I want is to create 2 or more tables using tables.sql file via PHP. PHP create_db.php DB_HOST, DB_USER, DB_PASSWORD, DB_NAME are defined in config.php file PHP v7.4.7 SQL tables.sql If I upload this tables.sql file directly to MySQL server using command line it is working. MySQL v8.0.20 MySQL Comunity Server – GPL Error message Error: 1064, You have an
How to retrieve all rows from an SQL table into an array?
I am trying to retrieve 4 rows and I expected that It should display all 4 rows but it’s only displaying the first row. This is the code I am using Answer If you want to get all rows from the result set then you need to fetch all. Right now you are fetching only one. To fetch all rows
How to assign the correct type to bind_param dynamically based on retrieved column types?
Background info: I am creating a class which will handle certain queries for me. One of these queries would be a SELECT query, where the user can select something based on a clause. I successfully retrieved the TYPES of the columns, but have no idea on how to actually decide based on the TYPE of the column which TYPE should
Why does the user input not append to my SQL database?
I’m developing a login/register form for my client. Right now I am working on the registration part of the form however I seem to have encountered an issue. I am trying to append the user’s input to a database if it does not currently exist. I’m developing this functionality using PHP version 7. However, the code does not seem to
Showing two different values depending on SESSION value in INNER JOIN
I have two different tables, one named users, and another named transactions. Transactions contains wallet1, wallet2, amount. Users contains user details such as firstname, lastname, and wallet. I am trying to display the corresponding first name and last name, depending on whether or not the SESSION_wallet is equal to wallet1 or wallet2 within transactions. I tried searching for a while,
How can i echo out the helper_tbl status column seperately and the getter_tbl status column field too
I want to be able to specify the table column am echoing . Am getting blank when i try to print out just from the helper column Answer Your problem is that both columns are called status, so when the result array is formed the second status value overwrites the first (since a PHP array can only have one value
mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, string given in while-loop
I currently have this code but it gives me the error mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, string given on line 22 The code is this: I can’t seem to find the error, I am running the same code in another file and there is no issues. Answer You are overwritting $result So you need to give your variables