scripterdx Posted October 29, 2009 Share Posted October 29, 2009 for the las couple of days i´ve been working on a widget or app, what this widget does is very simple, gets all the items that a user had picked forn a product list and show them in swf object, to be shared on Facebook, (all that works) but just to a single user (me) <?php include('config.php'); header('Content-Type: text/plain; charset=utf-8'); $sql= "SELECT producto FROM usuarios_actividad WHERE id_usuario=1207 AND lista=1 LIMIT 10"; $consulta = mysql_query($sql); $contador=0; while ($row = mysql_fetch_assoc($consulta)){ $lista=explode(',',$row['producto']); $contador++; ?> &id<?php echo $contador;?>=<?php echo $row['producto'];?> <?php } ?> & as you can see, the query is just for that specific user, i need to be to all users. how could i get to make that value variable: (id_usuario=1207) this must be a variable. thanks in advance Link to comment https://forums.phpfreaks.com/topic/179488-help-needed/ Share on other sites More sharing options...
seanlim Posted October 29, 2009 Share Posted October 29, 2009 $sql= "SELECT producto FROM usuarios_actividad WHERE id_usuario='".mysql_real_escape_string($_GET['id_usuario'])."' AND lista=1 LIMIT 10"; or replace it with any variable that holds the id. Link to comment https://forums.phpfreaks.com/topic/179488-help-needed/#findComment-947015 Share on other sites More sharing options...
scripterdx Posted October 29, 2009 Author Share Posted October 29, 2009 works fine, it dosen´t reconize the session eventhoug that i´ve put an include for the session i´ll keep working on that, BTW any of you have an idea to change a value with a clcik (link or button) lsita=0 to lista=1 (on /off) thats the way to choose the items for the widget Link to comment https://forums.phpfreaks.com/topic/179488-help-needed/#findComment-947032 Share on other sites More sharing options...
seanlim Posted October 29, 2009 Share Posted October 29, 2009 probably could achieve that with a checkbox <input type="checkbox"... Link to comment https://forums.phpfreaks.com/topic/179488-help-needed/#findComment-947054 Share on other sites More sharing options...
scripterdx Posted October 29, 2009 Author Share Posted October 29, 2009 Thanks. Link to comment https://forums.phpfreaks.com/topic/179488-help-needed/#findComment-947062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.