<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>ZenDB conversion question</title>
        <link>https://interactivetools.com/forum/forum-posts.php?ZenDB-conversion-question-82990</link>
        <description></description>
        <pubDate>Sat, 14 Mar 2026 06:20:46 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;ZenDB-conversion-question-82990" rel="self" type="application/rss+xml" />

                <item>
          <title>ZenDB conversion question</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247817#post2247817</link>
          <description><![CDATA[<p>Worked perfectly for my use case. Thank-you.</p>]]></description>
          <pubDate>Thu, 19 Dec 2024 12:33:55 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247817#post2247817</guid>
        </item>
                <item>
          <title>ZenDB conversion question</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247814#post2247814</link>
          <description><![CDATA[<p>Hi Jeff, </p>
<p>Glad to see you're trying out those new functions.  We have a built-in ZenDB function for that now: </p>
<pre class="language-php"><code>DB::tableExists($table)</code></pre>
<p>Which does this internally: </p>
<pre class="language-php"><code>public static function tableExists(string $tableName): bool
{
    $fullTable = self::getFullTable($tableName);
    return self::query("SHOW TABLES LIKE ?", $fullTable)-&gt;count() &gt; 0;
}</code></pre>
<p>You can pass it a table with or without a table prefix, and it will add one if needed.</p>
<p>Hope that helps! Let me know any other questions.</p>]]></description>
          <pubDate>Thu, 19 Dec 2024 12:14:43 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247814#post2247814</guid>
        </item>
                <item>
          <title>ZenDB conversion question</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247813#post2247813</link>
          <description><![CDATA[<p>I have an existing function to test if a table exists.:</p>
<pre class="language-php"><code>function testIfTableExists($table)
{
    global $TABLE_PREFIX;

    $sql = "SHOW TABLES LIKE '$TABLE_PREFIX$table'";
    $val = mysqli()-&gt;query($sql);
    return mysqli()-&gt;affected_rows &gt; 0 ? true : false;
}</code></pre>
<p>I am trying to update it to DB::query($sql), but the result is an empty array. Running the query in the MySQL console shows a single result with the table name. </p>
<p>Using ZenDB, what would be the recommended way to test if a table exists?</p>
<p>Instead of reinventing the wheel, is there a CMSB function determining whether a table exists?</p>]]></description>
          <pubDate>Thu, 19 Dec 2024 12:02:55 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247813#post2247813</guid>
        </item>
              </channel>
    </rss>
  