Welcome to the Robot Favorite Test
dbhost, $global->dbuser, $global->dbpass,
$global->dbname);
$dbase->setup_connection();
/* ============= start page ============= */
session_start();
// $robotid=(int)$_REQUEST['id'];
$_SESSION['returnpage'] = $_SERVER['REQUEST_URI'];
$robot=$_REQUEST['id'];
?>
issue_query($sql);
echo "
[robotid] --- [count] ";
while ($row = $result->fetch_assoc()) {
foreach ($row as $value)
// $robot[$count]=array_values($row)[1];
//
$robot[$count]= $row['robotid'];
// echo $robot[$count];
if ($count > '100') {
die ("count exceeded limit. $count");
}
echo "
robotid: " . $robot[$count] . ", count:" . $count;
$count++;
} // end while
} // end if userid
// $robot="812385871";
// $count=21;
/* === loop list favorite robots === */
for($loop = 0; $loop < $count; $loop++){
//
$robot = $robot[$loop];
$sql="SELECT * FROM `robot` WHERE `robotid`='" . $robot . "'";
$result=$dbase->issue_query($sql);
// while ($row = $result->fetch_assoc()) {
// foreach ($row as $value)
$row = $result->fetch_assoc();
$id = array_values($row)[0];
$admin = array_values($row)[1];
$user = array_values($row)[2];
$name = array_values($row)[3];
$description = array_values($row)[4];
$location = array_values($row)[5];
$type = array_values($row)[6];
$access = array_values($row)[7];
$online = array_values($row)[8];
$image = array_values($row)[9];
$ip = array_values($row)[10];
$robotid=$id;
// xxxxx
?>
|
issue_query($sql);
$row = $result->fetch_assoc();
$uid = $row['uid'];
$favorite = $row['robotid'];
echo "strings: $userid : $robot
table: $uid : $favorite
";
echo "favorite button";
if (($userid==$uid)&&($robot==$favorite)){
// button - remove from favorites
include ('inc/button.fav.delete.htm');
}else {
// button - add to favorites
include ('inc/button.fav.add.htm');
}
echo "action: [" . $_SESSION['action'] . "]";
?>
Wonder what will happen !!!