I will preface this with I am not knowledgeable and am using mysql not mysqli , I plan to change, this is only being used in my home for family. I have a database using phpmyadmin. I would like pull out the value to a webpage and have the result represented by specific image. I am currently just getting a blank icon as a result because it is not actually pulling the info, here is code, I know I have my tags incorrect is likely the issue
<?php
$db="homebase";
$link = mysql_connect("localhost", "sql","sql");
if (! $link)
die("ACCESS DENIED");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$sql = "SELECT * FROM table";
$rs_result = mysql_query ($sql);
$num_rows = mysql_num_rows($rs_result);
$query = mysql_query("SELECT * FROM table");
$number=mysql_num_rows($query);
print "<table width=250 Align=Left border=1 bordercolor=\"#000000\" bgcolor=\"E6E6E6\" style=\"border-collapse: collapse\" cellpadding=\"2\" cellspacing=\"1\">
<tr>
<td background=\"backgrounds/blue.jpg\"><font color=\"white\"><b>Availability</b></font></td>
\n";
while($rows=mysql_fetch_array($rs_result))
?>
<tr bgcolor='#e6e6e6'>
<td>
<img src="backgrounds/<?= $rows['Away'] ?>.png" border="0" align="center">
</td>
</tr>
</tr>
</table>
When I look in Chrome elements I can see this
img src="backgrounds/.png" border="0" align="center"
so value is not being pulled from db. Thank you
ok so I worked backwards and I am now getting the value but I want to convert the value to an image, I am only using the 1 set of php
<?php
$db="homebase";
$link = mysql_connect("localhost", "sql","sql");
if (! $link)
die("ACCESS DENIED");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$sql = "SELECT * FROM call";
$rs_result = mysql_query ($sql);
$num_rows = mysql_num_rows($rs_result);
$query = mysql_query("SELECT * FROM call");
$number=mysql_num_rows($query);
print "<table width=250 Align=Left border=1 bordercolor=\"#000000\" bgcolor=\"E6E6E6\" style=\"border-collapse: collapse\" cellpadding=\"2\" cellspacing=\"1\">
<tr>
<td background=\"backgrounds/blue.jpg\"><font color=\"white\"><b>Availability</b></font></td>
\n";
while($rows=mysql_fetch_array($rs_result)){
print "<tr>\n";
echo "<tr bgcolor='#e6e6e6'>
<td>".$rows['Away']."</td>
</tr>";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>