scripterdx Posted October 26, 2009 Share Posted October 26, 2009 I´m Writing a widget, a sort of wish list to integrate with facebook, the thing is i got this pice of code that gets the items with the most views, now i want to get the items from each user, (the user selects the items to display on the widget). ANY IDEAS? <?php include('config.php'); $v=$_GET['v']; switch ($v) { case 'v'://views $orden="ORDER BY visits DESC"; break; case 'n'://new //SELECT 10 RANDOM ITEMS $sql= "SELECT id FROM usuarios WHERE wish=1 ORDER BY RAND() LIMIT 10"; $consulta = mysql_query($sql); while ($row = mysql_fetch_assoc($consult)){ $lista_random[]=$row['id']; } $orden="AND id IN(".implode(',',$list_random).")"; break; case 's'://sale $orden="AND descuento!=0 ORDER BY precio"; break; case 'vo'://votes $orden="ORDER BY puntaje/votos DESC"; break; } // header('Content-Type: text/plain; charset=utf-8'); $sql= "SELECT * FROM productos WHERE online=1 $orden LIMIT 0,10"; $consult = mysql_query($sql); $counter=0; while ($row = mysql_fetch_assoc($consult)){ $pics=explode(',',$row['fotos']); $counter++; ?> &id<?php echo $counter;?>=<?php echo $row['id'];?> <?php } ?> & Link to comment https://forums.phpfreaks.com/topic/179056-help/ Share on other sites More sharing options...
scripterdx Posted October 26, 2009 Author Share Posted October 26, 2009 ohh BTW i got over 3000 users on my proyect. Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944681 Share on other sites More sharing options...
scripterdx Posted October 26, 2009 Author Share Posted October 26, 2009 sorry about the double post, but i need this topic to be on top Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944840 Share on other sites More sharing options...
lemmin Posted October 26, 2009 Share Posted October 26, 2009 Can you be more specific? I don't understand what you are trying to do. Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944843 Share on other sites More sharing options...
scripterdx Posted October 26, 2009 Author Share Posted October 26, 2009 it´s a script to add your favorite picks in an online store, already have a script to showcase the products with the most visits, now i want to show the products that the user pics. (i have a table where i check the users activity) Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944845 Share on other sites More sharing options...
lemmin Posted October 26, 2009 Share Posted October 26, 2009 But can you explain what is going on and what you want to change? You don't give any information about databases or anything. Plus, I don't speak Spanish very well! Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944849 Share on other sites More sharing options...
scripterdx Posted October 26, 2009 Author Share Posted October 26, 2009 i´ll try to explain it more first i want to copy the products ids from the products table into the user activity table, so i can make specific lists for each of the 3000+ users. Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-944857 Share on other sites More sharing options...
scripterdx Posted October 26, 2009 Author Share Posted October 26, 2009 i supose i´m not explianing my self very well. thanks any way Link to comment https://forums.phpfreaks.com/topic/179056-help/#findComment-945036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.