topical media & game development
basic-php-10-charlist.php / php
<?php
require('config.php');
if (isset(_GET['o'])) {
_GET['o'], 1), 3));
} else {
order = array(1 => 'alias ASC',
2 => 'name ASC',
3 => 'align ASC, alias ASC'
);
conn);
result = mysql_query(result) > 0) {
while (result)) {
row['id']][] = p as value) {
key] = implode(", ", sql = "SELECT c.id, n.alias " .
"FROM char_main c " .
"JOIN char_good_bad_link gb " .
"JOIN char_main n " .
"ON (c.id = gb.good_id AND n.id = gb.bad_id) " .
"OR (n.id = gb.good_id AND c.id = gb.bad_id)";
sql)
or die(mysql_error());
if (mysql_num_rows(row = mysql_fetch_array(e[row['alias'];
}
foreach (key => enemies[value);
}
}
sql = "SELECT id, alias, real_name AS name, align " .
"FROM char_main ORDER BY ". ord];
sql)
or die(mysql_error());
if (mysql_num_rows(table = "<table border=\"0\" cellpadding=\"5\">";
table .= "<a href=\"" . table .= "</th><th><a href=\"" . table .= "Name</a></th><th><a href=\"" . table .= "?o=3\">Alignment</a></th><th>Powers</th>";
bg = '';
while (result)) {
bg=='F2F2FF'?'E2E2F2':'F2F2FF');
powers[powers[enemies) || (row['id']]=='')) {
ene = row['id']];
}
bg . "\">" .
"<td><a href=\"charedit.php?c=" . row['alias']. "</a></td><td>" .
row['align'] . "</td><td>" . ene . "</td></tr>";
}
table = str_replace('evil',
'<font color="red">evil</font>',
table = str_replace('good',
'<font color="darkgreen">good</font>',
table;
?>
<br /><a href=<charedit.php>>New Character</a> •
<a href=<poweredit.php>>Edit Powers</a>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.