Hi guys, im working on a new site and im trying to input data from a mysql database that I set up. For some reason, I am not able to get data from Row 1?? Im new to coding, so not sure what it could be. Heres the code:
<?php
$db_host = 'localhost';
$db_name = 'sfpubcra_pub';
$db_user = 'sfpubcra_pub';
$db_pass = 'admin';
$pconn = 'off';
if($pconn == 'off') {
$db = mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
} else {
$db = mysql_pconnect($db_host, $db_user, $db_pass) or die(mysql_error());
}
mysql_select_db($db_name, $db);
$sql = "SELECT * FROM sfpubcra_pub.sfpubs";
$result = @mysql_query($sql,$db) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$name =$row['1'];
$url =$row['11'];
echo "var point = new GPoint(".$row['8'].",".$row['9'].");\n";
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\">".$row['1']."<br />".$url."<br />".$row['10']."</div>');\n";
echo "map.addOverlay(marker);\n";
echo "\n";
}
?>
So this returns the 8th and 9th rows successfully, but the $row['1'] shows up blank? in the html output from the php page it shows the field correctly, but its not displaying on the page.
<?php
$db_host = 'localhost';
$db_name = 'sfpubcra_pub';
$db_user = 'sfpubcra_pub';
$db_pass = 'admin';
$pconn = 'off';
if($pconn == 'off') {
$db = mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
} else {
$db = mysql_pconnect($db_host, $db_user, $db_pass) or die(mysql_error());
}
mysql_select_db($db_name, $db);
$sql = "SELECT * FROM sfpubcra_pub.sfpubs";
$result = @mysql_query($sql,$db) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$name =$row['1'];
$url =$row['11'];
echo "var point = new GPoint(".$row['8'].",".$row['9'].");\n";
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\">".$row['1']."<br />".$url."<br />".$row['10']."</div>');\n";
echo "map.addOverlay(marker);\n";
echo "\n";
}
?>
So this returns the 8th and 9th rows successfully, but the $row['1'] shows up blank? in the html output from the php page it shows the field correctly, but its not displaying on the page.