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 :)

Link to comment
Share on other sites

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),

);

 

 

Link to comment
Share on other sites

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  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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