Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Incorporate MySQL DB to website using PHP

Featured Replies

Hello,

 

I am looking to incorporate a database, which has been created within MySQL, into a website that I have built. I have managed to accomplish the basics of incorporating the DB to the site. They are communicating between each other. What I need help with is this;

 

I want to be able to make it so that when someone logs into the site, using details saved within the database, they are brought to their account homepage ... this is where my troubles start ... I want to be able to populate certain parts of the site with information linking to them. I have all relationships set-up amongst the tables within the DB but I am struggling with incorporating it once a user has logged in.

 

I understand the concept ... carrying over the username Primary Key and using that to link to everything else but I don't know how to carry this information over to another page and then use it to populate fields.

 

Any help with this shall be very much appreciated.

 

- MjA -

What I would do is create $_SESSION variables. On successful login you then set the variables you wish to 'carry around' the site such as $_SESSION['userid'] for the ID of the user. Then when a user goes to their 'account' page you can use the $_SESSION['userid'] as a reference to get the information you wish to display.

  • Author

Thank you for your response.

 

I will look into this and try and get it working.

 

It can sometimes be difficult when you understand what you want to achieve, and even understanding the concept, but not know how to word it.

 

- MjA -

It can sometimes be difficult when you understand what you want to achieve, and even understanding the concept, but not know how to word it.

 

Man, you hit the nail on the head there, it's called development :D

  • Author

I just wanted to update this.

 

I have managed to accomplish this thanks to your help. Very much appreciated.

 

- MjA -

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.