scripterdx Posted October 27, 2009 Share Posted October 27, 2009 i´m fried i cant see it, i have this code INSERT INTO `usuarios` (widget_prod) SELECT `producto` FROM `usuarios_actividad` WHERE `id_usuario`=1207 AND `lista`=1 but i want that widget_prod stores all the data for that specific user Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/ Share on other sites More sharing options...
onlyican Posted October 27, 2009 Share Posted October 27, 2009 Where to Start. 1) That is a query not an array 2) The query above is insert the PRODUCTO from USUARIOUS_ACTIVIDAD where ID)USUARIO is 1207 and LISTA is 1 into a new entry, in Usuarious, in a field widget_prod Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945483 Share on other sites More sharing options...
scripterdx Posted October 27, 2009 Author Share Posted October 27, 2009 i know that was a query, i´m asking for some help and ideas to, make that results like this ID 1 email [email protected] widget 1,2,3,4,5,6 etc instead of id 1 email [email protected] wiget 1 id 2 wiget 2 id 3 wiget 3 Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945488 Share on other sites More sharing options...
purpleshadez Posted October 27, 2009 Share Posted October 27, 2009 i know that was a query, i´m asking for some help and ideas to, make that results like this ID 1 email [email protected] widget 1,2,3,4,5,6 etc instead of id 1 email [email protected] wiget 1 id 2 wiget 2 id 3 wiget 3 Not sure I get you. Code examples of what you've already got and/or a better idea of what you are trying to accomplish would be useful. Because it looks to me that you have an issue with how your database table is setup?!? Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945507 Share on other sites More sharing options...
scripterdx Posted October 27, 2009 Author Share Posted October 27, 2009 it´s the data base it´s fine, i got a table that gets all the user activity, so there´s a product whit am id then i select that product to be on my list, so i get this query SELECT `producto` FROM `usuarios_actividad` WHERE `id_usuario`=1207 AND `lista`=1 and i want to copy the product id to the user table, so i can make an unique list for each of my 3000 members, te ideal result is ID USER WIDGET DATE 1 [email protected] 234,34,54,35 date Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945518 Share on other sites More sharing options...
onlyican Posted October 27, 2009 Share Posted October 27, 2009 I think I understand I dont think you can do this with just SQL You will need to run your SELECT query Loop through the results, separating each with a comma then insert into your table Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945526 Share on other sites More sharing options...
scripterdx Posted October 27, 2009 Author Share Posted October 27, 2009 like with implode? Link to comment https://forums.phpfreaks.com/topic/179199-help-with-a-simple-array/#findComment-945637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.