Location: PHPKode > projects > The Community Wish List Server > wlserver/rcprivate.php
<?
/* simple stuff to update the wishlist database online without fussing with telnet */
print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
print("<!DOCTYPE html\n");
print("PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n");
print("\t\" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >\n");
print("\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n");
print("\t\t<head>\n");
print("\t\t\t<title>Richard's Private Wish List Fix Page</title>\n");
print("\t\t</head>\n");
print("\t<body>\n");
print("Updating table: peopleSeeOthers\n");

require("../php2/dbconnect.php");

// Clear out old values
//print ("Clearing out table...<br>");
//$dSQL = "delete from peopleSeeOthers";
//$xq = mysql_query($dSQL);

// Step 1: Get all personKey values
$sSQL = "select personKey from person";
$xq = mysql_query($sSQL);
$np = mysql_num_rows($xq);
for ($i=0;$i<$np;$i++) {
	$pArray[$i]=mysql_result($xq,$i,"personKey");
}

// Step 2: Match up everyone with everyone else
/*
	In this case, simply add the personKey for everyone for test
*/

$tn=0;
for ($i=0;$i<$np;$i++) {
	$pvArray[$tn][0] = 33;
	$pvArray[$tn][1] = $pArray[$i];
	$tn++;
}


// Step 3: Populate the peopleSeeOthers table
/*
	But first, let's show the table, just to make sure it worked right
*/

?>

<table border="1" cellpadding="2" cellspacing="0">

<?php

for ($i=0;$i<$tn;$i++) {
	$p1=$pvArray[$i][0];
	$p2=$pvArray[$i][1];
	print("<tr><td>$p1</td><td>$p2</td></tr>");
	$iSQL=("insert into peopleSeeOthers (userKey,showKey) values ($p1,$p2)");
	$xq=mysql_query($iSQL);
}

?>

</table>
Return current item: The Community Wish List Server