Question: How do I retrieve values from mysql database from current session or based on username? Trying to create a mostly pre-populated html form with values

How do I retrieve values from mysql database from current session or based on username?

How do I retrieve values from mysql database from current session or

Trying to create a mostly pre-populated html form with values based on the ones already in database. If the database does not yet have a value for it, I want it to print out such (e.g. "Empty!")

For the username slot, I was able to pre-populate the field using value="" However when I try that with email I get an error. Here is the php I'm using in the file.

based on username? Trying to create a mostly pre-populated html form with

values based on the ones already in database. If the database does

not yet have a value for it, I want it to print

Some data was already input from user registration page. Such as Username, and E-mail. But I would like the available data to populate and if not available echo empty!. I also need the data submitted to be able to be input into the database. For example address, first name, and last name. Which was not input by the user on the registration page. Form looks like this:out such (e.g. "Empty!") For the username slot, I was able to

Table "users" for Database ucast. All of the information populated is from registration. Once logged in they should see pre-populated data from the database relative to their account with the option to upgrade non-readonly fields. If the database doesn't have anything for that field, I would like it to echo a statement saying such.

pre-populate the field using value="" However when I try that with email

I get an error. Here is the php I'm using in theRight now when I try to echo the Email is html value=" " it just shows the error above in that field.

Email
Notice: Undefined variable: email in Z:\xampp\htdocs\Cast\dashboard.pl db.php 1 2 3 dashboard.php auth_session.php

+ Options T Edit Copy id username pin fname Iname email password create datetime Alex@Cast.com 098f6bcd4621d373cade4e832627b4f6 2021-03-16 19:37:40 Delete 7 Alex 0 User Information First name Last name Address Email
Notice: Undefined variable: email in Z:\xampp\htdocs\Cast\dashboard.pl Username Alex Password Confirm Cancel Save Changes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!