<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037146" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037146</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-load-image-based-database-table-status#comment-1213290</link>
    <description> &lt;p&gt;This is a little difficult to answer without knowing how the database is setup. Are the lots held in one table with the status in another?&lt;/p&gt;
&lt;p&gt;To query the database you probably want to do something like:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$conn &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;host\&quot;,\&quot;username\&quot;,\&quot;password\&quot;);&lt;br /&gt;&lt;br /&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$conn&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; die(\&quot;Could not connect to DB. Error: \&quot; . mysql_error();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_select_db(\&quot;databasename\&quot;); &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;SELECT lotname, statusname &lt;br /&gt;&amp;nbsp;&amp;nbsp; FROM lot&lt;br /&gt;&amp;nbsp;&amp;nbsp; INNER JOIN status ON lot.statusid = status.statusid\&quot;; &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) { &lt;br /&gt;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;img src=\&quot;&#039; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;lotname\&quot;] . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;lotstatus\&quot;] . &#039;.gif\&quot; width=\&quot;50\&quot; height=\&quot;50\&quot; alt=\&quot;&#039; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;lotname\&quot;] . &#039; is &#039; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;lotstatus\&quot;] . &#039;\&quot; /&amp;gt;&#039;;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Note: the &#039;host&#039; in mysql_connect is usually localhost.&lt;/p&gt;
&lt;p&gt;I can&#039;t really test this so you might find some problems, it does also require you to fill-in a few details, such as: the host, username/password, table names in the SQL etc.&lt;/p&gt;
&lt;p&gt;Hopefully this will give you a start. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 11 Jan 2007 10:56:40 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1213290 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-load-image-based-database-table-status#comment-1213263</link>
    <description> &lt;p&gt;No, I have very little database coding experience. I had planned on just having sperate images for each lot status.&lt;/p&gt;
&lt;p&gt;I could figure out that its just simple if then&#039;s.. problem is, I don&#039;t know how to query the database to check the status.&lt;/p&gt;
&lt;p&gt;I was thinking something like this. I know its not pretty or neat.. but I need to get this done tonight. &lt;/p&gt;
&lt;p&gt;If status of lot 1 = open&lt;br /&gt;
then display lot1open.gif&lt;/p&gt;
&lt;p&gt;elseif status of lot 1 = reserved&lt;br /&gt;
then display lot1reserved.gif&lt;/p&gt;
&lt;p&gt;else status of lot 1 = sold&lt;br /&gt;
then display lot1sold.gif&lt;/p&gt;
&lt;p&gt;Then just do that for EACH lot.&lt;/p&gt;
 </description>
     <pubDate>Thu, 11 Jan 2007 01:39:52 +0000</pubDate>
 <dc:creator>cyr0n_k0r</dc:creator>
 <guid isPermaLink="false">comment 1213263 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-load-image-based-database-table-status#comment-1213262</link>
    <description> &lt;p&gt;It should be a case of simple conditionals... Firstly, ensure that your image has a transparent background. Your basic markup (when the image is white) would look like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;img src=&amp;quot;blah.gif&amp;quot; with=&amp;quot;50&amp;quot; height=&amp;quot;50&amp;quot; style=&amp;quot;background-color: white;&amp;quot; &amp;gt;&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;So... assuming that you already have the status from the database and you have a choice of three values, you simply do the following:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$status &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;== &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sold&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) { &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$color &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;red&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;br /&gt;&lt;br /&gt;} elseif(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$status &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;== &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;reserved&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) { &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$color &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;gray&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;br /&gt;&lt;br /&gt;} else { &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$color &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;white&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Then modify your markup for the image to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;img src=&amp;quot;blah.gif&amp;quot; with=&amp;quot;50&amp;quot; height=&amp;quot;50&amp;quot; style=&amp;quot;background-color: &amp;lt;?= $color ?&amp;gt;;&amp;quot; &amp;gt;&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;(obviously, this is all assuming that you are looping through the database to pull out each image)&lt;/p&gt;
 </description>
     <pubDate>Thu, 11 Jan 2007 01:33:56 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1213262 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
