Forum Moderators: coopster
I want to pull data from the database and create a link at the end of a table.
Thanks,
StevieMac
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>><td>%s</td></tr>\n", $myrow["Latitude"], $myrow["Longitude"], $myrow["SSID"], $myrow["BSSID"], $myrow["Link"]"<a href=\"http://terraserver.microsoft.com/image.aspx?Lon=$myrow["Longitude"]&Lat=$myrow["Latitude"]&w=1&ref=G¦$myrow["Longitude"],$myrow["Latitude"]">Link</a>);
/* Connecting, selecting database */
$link = mysql_connect("localhost","joe_user", "mypassword")
or die("Could not connect : " . mysql_error());mysql_select_db("myhost_dbname") or die("Could not select database");
$query = "SELECT * FROM tablename";
$result = mysql_query($query);
echo "<TABLE BORDER=\"0\">\n";
while($row = mysql_fetch_array($result)) {
echo "<TR><TD nowrap><a href=\"/".$row['URL']."/\">".$row['LinkText']."</a></TD></TR>\n";
}
echo "</TABLE>\n";/* Closing connection */
mysql_close($link);
@mysql_connect("localhost","username","password");
@mysql_select_db("database");
$sql = 'SELECT * FROM table';
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result)!= 0){
echo "<table>";
while($row = mysql_fetch_array($result)){
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td><a href=\"http://terraserver.microsoft.com/image.aspx?Lon=$row[1]&Lat=$row[0]&w=1&ref=GĻ$row[1],$row[0]\">Link</a></td></tr>\n";
}
echo "</table>";
}
$sql = 'SELECT latitude, longitude, ssid, bssid FROM table';