cs.punk Posted December 29, 2008 Share Posted December 29, 2008 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 https://forums.phpfreaks.com/topic/138787-selecting-only-specified-entries-in-a-database-with-images/ Share on other sites More sharing options...
awpti Posted December 29, 2008 Share Posted December 29, 2008 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 https://forums.phpfreaks.com/topic/138787-selecting-only-specified-entries-in-a-database-with-images/#findComment-725715 Share on other sites More sharing options...
cs.punk Posted December 30, 2008 Author Share Posted December 30, 2008 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 https://forums.phpfreaks.com/topic/138787-selecting-only-specified-entries-in-a-database-with-images/#findComment-726044 Share on other sites More sharing options...
cs.punk Posted December 31, 2008 Author Share Posted December 31, 2008 Hmm....... Is there any such command as copy with MYSQL? As i could then select all entries with the specified ID and copy the results to the other database Link to comment https://forums.phpfreaks.com/topic/138787-selecting-only-specified-entries-in-a-database-with-images/#findComment-727280 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.