Help - Search - Members - Calendar
Full Version: Stopping From Showing Flag
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
House
Hi there peeps problem you could say.

I have a map of the UK. and on the map are little flags. When someone clicks on a flag a wee popup box comes up and lists the events that are relative to that location

Problem.

If there are no events at that location, then I want it to not show the flag.

Out of the source below. How would I do that?

CODE
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Image layers</title>
</head>
<body>
<img src=UK2.gif>

<?php
mysql_connect("localhost", "root", "PASS")or die("Whoops! That's not working cause: <br><br>".mysql_error());
mysql_select_db("DB")or die("<br>Cannot select db!!!!<br><br>".mysql_error());




$query = "SELECT * FROM VENUES";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){

echo "\n\n<div style=\"position:absolute; top:".$row['X']."px; left:".$row['Y']."px;\">\n\n";
echo "<a href=\"java script:void(0);\" onclick=\"return overlib('";

// Begin while loop to view current conferences
$conf = "SELECT * FROM conferences WHERE VENUE = '".$row['VENUE']."'";
$conf_result = mysql_query($conf)or die(mysql_error());

while($con = mysql_fetch_array($conf_result)){


echo "<a href=#>".htmlspecialchars($con['CONFERENCE'], ENT_QUOTES)."</a><br>";
}


echo "', STICKY, CAPTION, '".$row['VENUE']."');\"><img src=\"flag_pink.png\" border=\"0\" alt=\"".$row['VENUE']."\"></a>\n\n";
echo "</div>\n\n";
}


Basically $con selects from the conference database, and $row selects from the venues database.

I don't need to know how to do anything special. Just need to know if mysql_fetch_array() is showing back as nothing.

Regards
House
THanks for your replies people! lol..

Anyway, got it sorted.

Tom
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.