Here's part of the code. It's all pretty much just querying MySQL databases. I took out the urls for the files, but I have the correct ones in the real file.
require_once('database class file');
if ($_POST['action'] == 'listAll') {
$sql = 'SELECT * FROM bandlist ORDER BY band_name';
echo getUserList($sql);
}
function getUserList($sql) {
$db = new Database('sql server name',username,password,table);
$result = $db->query($sql);
$numrows = $result->num_rows;
$userlist = "total=$numrows";
$counter = 0;
while ($row = $result->fetch_assoc()) {
$userlist .= '&band_id'.$counter.'='.urlencode(stripslashes($row['band_id']));
$userlist .= '&band_name'.$counter.'='.urlencode(stripslashes($row['band_name']));
$userlist .= '&band_picture'.$counter.'='.urlencode(stripslashes($row['band_picture']));
$counter++;
}
$db->close();
return $userlist;
}
This code fails to run on my server, but works perfectly on my own computer.