2

In zend it is written like

$table = $this->getTable();
        $select = $table->select()->where('status = ?',1)
                                ->where('columnOne= ?', 1) 
                                ->order('columnTwo')
                                ->limit(1);

similar to where, order, limit conditions how can I condition for LIKE?

My query is

SHOW TABLE STATUS LIKE 'tableName'

I tried in this way

    $table = $this->getTable();
                $query= $table->select("TABLE STATUS")
                                ->like($table);
    $id = mysql_query($query);

then I found that no method for LIKE is available in ZEND. Then How can I write above query in Zend framerk?

Thanks in advance.

3
  • fish through the methods in the core class. I swear I remember using a static method to get a list of all tables in a specific schema. But I cannot find anything in the documentation. Commented Jul 29, 2011 at 5:27
  • @Alan B. Dee : there is no object or method for SHOW statement like SELECT statement nor for LIKE opererator like WHERE operator. Commented Jul 29, 2011 at 6:34
  • @Alan: there is a listTables() method on the db adapter which is probably what you are referring to. Commented Jul 29, 2011 at 8:26

1 Answer 1

7

This works for me, so hopefully it should give you what you want:

$stmt = $dbAdapter->query("SHOW TABLE STATUS LIKE '$tableName';");
$tableStatus = $stmt->fetchObject();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.