Jump to content

Selecting only specified 'entries' in a database with images?


cs.punk

Recommended Posts

Ok I got a big database full of stuff. In one table theres: User: Date: ID:.

 

Now how do I 'select' only for example ID: 66622,66641,66691,66681 etc to show on the homepage? (Yeah but having to 'select' this on the settings page of mine only, add so it can be some sort of a form?)

 

Secondly how would I attach images to these users?

 

Thank you for reading this if you have lol :)

SELECT * FROM some_table WHERE id IN(12345,213123,3412,4512,534647).

 

As far as attaching images to users?

 

Data normalization. Link the image to the user ID.

 

eg;

 

CREATE TABLE my_images (

  `id` int not null primary key auto_increment,

  `user_id` int, #references users.id

  `image_name` varchar(128),

);

 

 

Ok yes but now to make a form for that and then the results must show on another page?... The best way I can think of is make another table, and just edit it on one page and on the homepage I just select * from the table.

 

Any better way to do it?

 

Cause say now you have 500 entries to show. Now you want to ad 10, are you gonna write all 510 entries? I think not lol...

 

If anyone knows a better way or better 'rule' to do this please post it  :)

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.