PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$prev_cid = "";
while ($row = mysql_fetch_assoc($result)) {
// test if new category is started
if ($row['cid'] != $prev_cid) {
// eg: ould output a </tr><tr> line to start a new table row
}
// display station
// echo stuff with $row['sname'] etc...
// update the previous cid
$prev_cid = $row['cid'];
}
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/carl/public_html/mradio/station.php on line 6
Station Name Mercora Name
Fatal error: Call to undefined function: mysql_fetch_aassoc() in /home/carl/public_html/mradio/station.php on line 12
Well, it's obvious that the fatal error is because you spelled mysql_fetch_assoc()wrong. Simple mistake.
The other message is telling you $cat is not a valid resource - likely because of something wrong with your query. Copy and paste your query into the command line and see what kind of error MySQL gives you.
Also, using [syntax=php][/syntax] tags colourizes your PHP code a lot nicer that the [syntax=php][/syntax] tags.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_query("SELECT cid, sid, sname, mname FROM station INNER J