Jump to content

[SOLVED] can any 1 tell me or show me how i can put images into a database?


runnerjp

Recommended Posts

I assume that when a person logs in you use a session variable. When you set the session variable for the login, just grab the user id as well and set that as a session variable.

 

When a person uploads an image, just add another piece into your code to insert that session variable containing their user id in the image table.

 

That way when you go to pull the image out of the database, you can do something like

$user_id=$_SESSION['user_id'];
"SELECT * FROM images WHERE user_id='$user_id'";

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.