Re: NOPE: [PHP] HELP: Re: Table comments
| From: | Mike Eheler | Date: | Sat, 27 Oct 2001 21:06:32 +0000 |
| Subject: | Re: NOPE: [PHP] HELP: Re: Table comments | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72590@lists.php.net to get a copy of this message | ||
That's because you're not selecting a database.
You need to either put the database name in mysql_select_db, or change the query to:
SHOW TABLE STATUS FROM databasename LIKE 'table_name';
so change the line to:
$sql = "SHOW TABLE STATUS FROM db_name LIKE 'bookmark_unit4'";
Mike
jtjohnston wrote:
I'm still getting "Supplied argument is not a valid MySQL result resource" for: while ($data = mysql_fetch_array($result)) { mysql_free_result($result); presumably $result <?php $myconnection = mysql_pconnect("localhost","",""); mysql_select_db("",$myconnection); $sql = 'SHOW TABLE STATUS LIKE bookmark_unit4'; $result = mysql_query($sql); // Only returning 1 row, but I put it in a while() loop in case the result is empty // Then I don't get any errors. while ($data = mysql_fetch_array($result)) {$table_comment = $data['Comment'];} mysql_free_result($result); mysql_close($myconnection); echo $table_comment; ?>