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 Quote Link to comment 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 Quote Link to comment 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 s@s.com widget 1,2,3,4,5,6 etc instead of id 1 email s@s.com wiget 1 id 2 wiget 2 id 3 wiget 3 Quote Link to comment 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 s@s.com widget 1,2,3,4,5,6 etc instead of id 1 email s@s.com 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?!? Quote Link to comment 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 s@w.com 234,34,54,35 date Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
scripterdx Posted October 27, 2009 Author Share Posted October 27, 2009 like with implode? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.