Jump to content

HELP!!!!!!!


scripterdx

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

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