Basically, what I'm trying to do is create a text-only mirror of my PHP Nuke's calendar to use on cell phones. I've had a little bit of success, but I can't seem to get this right. Can someone scan my code and tell me exactly what I'm doing wrong?
<?php
$dbcnx = @mysql_connect('mysqlserver', 'myusername', 'mypass');
if (!@mysql_select_db('pittpunk')) {
exit('<p>Unable to locate the joke ' .
'database at this time.</p>');
}
$result1 = @mysql_query('SELECT title, categoryid, onetime_date FROM nuke_nucal_events WHERE onetime_date >= CURRENT_DATE ORDER BY `onetime_date` ASC');
if (!$result1) {
exit('<p>Error performing query: ' . mysql_error() .
'</p>');
}
$row = mysql_fetch_array($result1);
$row2 = mysql_fetch_array($result2);
$result2 = @mysql_query("SELECT id, title FROM nuke_nucal_categories WHERE id='$row[categoryid]' ORDER by id");
if (!$result2) {
exit('<p>Error performing query: ' . mysql_error() .
'</p>');
}
while ($row = mysql_fetch_array($result1))
{
echo 'Date: ' .$row['onetime_date']. '<br>';
echo 'Bands Playing: ' .$row['title'].'<br>';
echo 'Location: ' .$row2['title']. '</p>';
}
?>
All I can't figure out is how to get the results from the second SELECT statement to show up. I know I've worded this horribly, and I'm pretty new at this. If anyone could help, I'd owe you my life.