<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Pulling Image Data from another Table</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Pulling-Image-Data-from-another-Table-70683</link>
        <description></description>
        <pubDate>Wed, 18 Nov 2026 19:03:39 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Pulling-Image-Data-from-another-Table-70683" rel="self" type="application/rss+xml" />

                <item>
          <title>Re: [aquaman] Pulling Image Data from another Table</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2201002#post2201002</link>
          <description><![CDATA[Hi aquaman,<br /><br />You're setting a $num variable, but then using $aboutRecord['static_image_2'] in your where clause. Try this? (changes in red)<br /><br /><code>$num = $aboutRecord['static_image_2'];  <br />if (!$num) { $num = 47; } // default num <br />list($header_images_smallRecords, $header_images_smallMetaData) = getRecords(array( <br />  'tableName' =&gt; 'header_images_small', <br />  'where'		  =&gt; &quot;num ='<span style="color:red">$num</span>'&quot;, <br />  'limit'     =&gt; '1', <br />)); <br />$header_images_smallRecord = @$header_images_smallRecords[0]; // get first record <br /><span style="color:red">if (!$header_images_smallRecord) { print &quot;Could not find a header_images_small record for num = '$num'&quot;; exit; }</span></code><br /><br />I hope this helps. Please let me know if you have any questions.<br />]]></description>
          <pubDate>Thu, 07 Jan 2010 16:24:24 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2201002#post2201002</guid>
        </item>
                <item>
          <title>Re: [chris] Pulling Image Data from another Table</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2201001#post2201001</link>
          <description><![CDATA[Hi Chris, I think I'm almost there, I'm getting this error now:<br /><br />Warning: Invalid argument supplied for foreach() see code below for &quot;Error showing here&quot;<br /><br /><code>		&lt;?php elseif ($aboutRecord['header_type'] == 'static'): ?&gt;<br />			&lt;?php<br />			  $num = $aboutRecord['static_image_2']; <br />			  if (!$num) { $num = 47; } // default num<br />			  list($header_images_smallRecords, $header_images_smallMetaData) = getRecords(array(<br />				'tableName'   =&gt; 'header_images_small',<br />				'where'		  =&gt; &quot;num ='{$aboutRecord['static_image_2']}'&quot;,<br />				'limit'       =&gt; '1',<br />			  ));<br />			  $header_images_smallRecord = @$header_images_smallRecords[0]; // get first record<br />			?&gt;<br />			&lt;div class=&quot;feature&quot;&gt;<br />			&lt;?php foreach ($header_images_smallRecord['image'] as $upload): ?&gt; // Error showing here<br />			  &lt;?php if ($upload['isImage']): ?&gt;<br />				&lt;img src=&quot;&lt;?php echo $upload['urlPath'] ?&gt;&quot; width=&quot;&lt;?php echo $upload['width'] ?&gt;&quot; height=&quot;&lt;?php echo $upload['height'] ?&gt;&quot; alt=&quot;&lt;?php echo $header_images_smallRecord['title'] ?&gt;&quot; /&gt;<br />			  &lt;?php endif ?&gt;<br />			&lt;?php endforeach ?&gt;<br />			&lt;/div&gt;		<br />		&lt;?php endif ?&gt;</code><br />]]></description>
          <pubDate>Thu, 07 Jan 2010 15:57:00 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2201001#post2201001</guid>
        </item>
                <item>
          <title>Re: [aquaman] Pulling Image Data from another Table</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2200924#post2200924</link>
          <description><![CDATA[Hi aquaman,<br /><br />Sorry we didn't get back to you sooner! Winter holidays and all.<br /><br />You can default to a specific header_images_small record like this:<br /><br /><code>&lt;?php <br />  $num = $aboutRecord['static_image_2'];<br />  if (!$num) { $num = <span style="color:red">123</span>; } // default num<br />  list($header_images_smallRecords, $header_images_smallMetaData) = getRecords(array( <br />    'tableName'   =&gt; 'header_images_small', <br />    'where'		  =&gt; &quot;num ='{$num}'&quot;, <br />    'limit'       =&gt; '1', <br />  )); <br />  $header_images_smallRecord = @$header_images_smallRecords[0]; // get first record <br />?&gt;</code><br /><br />You'll want to replace 123 above with the record number of a header_images_small record you want to use as a default.<br /><br />I hope this helps! Please let me know if you have any questions.<br />]]></description>
          <pubDate>Mon, 04 Jan 2010 18:45:31 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2200924#post2200924</guid>
        </item>
                <item>
          <title>Re: [aquaman] Pulling Image Data from another Table</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2200865#post2200865</link>
          <description><![CDATA[OK, looks like I managed to work this out after sleeping on it BUT I need to show a default image if none selected to stop it throwing a mysql error.<br /><br />This is what's inserted into the body of my aboutRecord page to pull the image from another table:<br /><br /><code>&lt;?php<br />  list($header_images_smallRecords, $header_images_smallMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'header_images_small',<br />    <b>'where'		  =&gt; &quot;num ='{$aboutRecord['static_image_2']}'&quot;,</b><br />    'limit'       =&gt; '1',<br />  ));<br />  $header_images_smallRecord = @$header_images_smallRecords[0]; // get first record<br />?&gt;<br /><br />&lt;?php foreach ($header_images_smallRecord['image'] as $upload): ?&gt;<br />  &lt;?php if ($upload['isImage']): ?&gt;<br />	Image stuff code here<br />  &lt;?php endif ?&gt;<br />&lt;?php endforeach ?&gt;</code><br />]]></description>
          <pubDate>Wed, 30 Dec 2009 12:45:46 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2200865#post2200865</guid>
        </item>
                <item>
          <title>Pulling Image Data from another Table</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2200839#post2200839</link>
          <description><![CDATA[Hi there, <br /><br />Here is what I am trying to achieve:<br /><br />I wish to upload a series of banner images in one table and then select those from a dropdown menu in another table for page content (This way I can just select a banner image to display rather than uploading each time a page is added).<br /><br />The banner image table has two fields:<br />-Title<br />-Image (upload)<br /><br />The page content table has the following setup for the dropdown:<br />-Display As: pulldown<br />-Get options from database<br />-Section Tablename: header_images_small<br />-Use this field for option values: num<br />-Use this field for option labels: title<br /><br />So far so good - it's all working. My question is:<br /><br />What do I insert into my viewer code to display the image? <br /><br />Many thanks again :)<br />]]></description>
          <pubDate>Mon, 28 Dec 2009 23:17:20 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2200839#post2200839</guid>
        </item>
              </channel>
    </rss>
  