Jump to content

abc1000000

New Members
  • Posts

    5
  • Joined

  • Last visited

abc1000000's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Some steps forward and some steps back. I uninstalled and reinstalled MySQL and added a password created by a password manager. I then inserted that password into the code, and tried to submit some data into the form. It appears the password issue is gone, but it doesn't recognise the database. I get the following error Fatal error: Uncaught mysqli_sql_exception: Unknown database 'staff' in C:\xampp\htdocs\GeeksforGeeks\insert.php:16 Stack trace: #0 C:\xampp\htdocs\GeeksforGeeks\insert.php(16): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'staff') #1 {main} thrown in C:\xampp\htdocs\GeeksforGeeks\insert.php on line 16 In phpMyAdmin the database 'staff' appears to exist. What do I need to do to get everything working? Thank you!
  2. Thanks. I'm going to go for some exercise and try that in an hour or so. Why would the mysql root user have a password account? I absolutely didn't add one after installing xampp - would this be a holdover from a previous install of mysql? Thanks again!
  3. FYI I also tried following https://www.geeksforgeeks.org/how-to-insert-form-data-into-database-using-php/ and got a similar looking error - "Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\GeeksforGeeks\insert.php:16 Stack trace: #0 C:\xampp\htdocs\GeeksforGeeks\insert.php(16): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'staff') #1 {main} thrown in C:\xampp\htdocs\GeeksforGeeks\insert.php on line 16" FWIW line 16 is "$conn = mysqli_connect("localhost", "root", "", "staff");" I'm just so frustrated. Once I get this set up I can experiment with more complicated forms, grabbing the data from them and doing funky stuff with it etc. I'll make something amazing. Right now I can't get it set up to receive someone's name, and am stuck.
  4. Hi Mac, thank you. I followed the instructions in those urls. I downloaded and installed XAMPP. I had downloaded and installed mysql, phpMyAdmin and mysql workbench but that was previous. Is it possible that's the issue? I really thought this would be a lot easier - I'm just trying to set up the most basic html to php to mysql system possible and then play around from there. I can't even do that, so am unable to make any progress with my project. It's incredibly frustrating. I've spent hours on it but nothing.
  5. Hi. I'm looking to set up some simple code that sent data submitted on a forms to a database on a website and it's not so simple! I thought I'd start with doing it on a local server then move that to online but I keep running in to an error. I' tried to set up a simple html->php->MySQL page using the code here: https://www.raghwendra.com/blog/how-to-connect-html-to-database-with-mysql-using-php-example/ unfortunately when submitting form data to test I get the following error message "Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\contact\contact.php:5 Stack trace: #0 C:\xampp\htdocs\contact\contact.php(5): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'db_contact') #1 {main} thrown in C:\xampp\htdocs\contact\contact.php on line 5" I also tried setting up a simple html->php->MySQL page using the code on https://www.webcodzing.com/connect-html-form-to-mysql-database-using-php/ which is much the same but with the database being password protected. That time I got the following error code: Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'formdb_user'@'localhost' (using password: YES) in C:\xampp\htdocs\testsite\form.php:22 Stack trace: #0 C:\xampp\htdocs\testsite\form.php(22): mysqli_connect('localhost', 'formdb_user', Object(SensitiveParameterValue), 'form_entriesdb') #1 {main} thrown in C:\xampp\htdocs\testsite\form.php on line 22 How do I resolve this? I'm finding this all very frustrating and just want to know how to fix it. Thank you!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.