Since it's a LIKE, you need to put the table name in quotes:

SHOW COLUMNS FROM test LIKE 'Var'

This also allows you to use things like 'Var%' in you query.
 
Steve Meyers


> -----Original Message-----
> From: TD - Sales International Holland B.V. [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 9:29 AM
> To: [EMAIL PROTECTED]
> Subject: Problem listing enum vars
> 
> 
> Hey there,
> 
> first off all, please CC me any replies, as I'm no longer a member of the 
> list... Sorry about that but I just receive too much... Over 2000 
> emails a 
> day is no exception and I can no longer keep track of them.
> 
> Ok, for the problem, I want to list the possible values of a enum 
> variable.
> 
> In the manual it says:
> 
> If you want to get all possible values for an ENUM column, you 
> should use: 
> SHOW COLUMNS FROM table_name LIKE enum_column_name and parse the ENUM 
> definition in the second column.
> 
> I have a database called RMA with a table called test with a enum 
> in there 
> called Var.
> 
> Here comes a paste from my mysql client.
> 
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 8 to server version: 3.23.40
>  
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>  
> mysql> use RMA;
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
>  
> Database changed
> mysql> describe test;
> +-------+---------------------------------------------------------
> ------------------------------------------+------+-----+---------+-------+
> | Field | Type
>     | Null | Key | Default | Extra |
> +-------+---------------------------------------------------------
> ------------------------------------------+------+-----+---------+-------+
> | Var   | enum('Omgeruild - RMA Stock','Omgeruild - DOA','Credit 
> Nota','Defect Gevonden','Out Of Warranty') | YES  |     | NULL    
> |       |
> +-------+---------------------------------------------------------
> ------------------------------------------+------+-----+---------+-------+
> 1 row in set (0.00 sec)
>  
> mysql> SHOW COLUMNS FROM test LIKE Var;
> ERROR 1064: You have an error in your SQL syntax near 'Var' at line 1
> 
> This manual is from 3.23.39 and I'm using 3.23.40, that shouldn't 
> be an issue 
> right? So what am I doing wrong here?? :-(
> I need it for PHP, so it can create a html dropdown box with 
> those values....
> 
> Kind regards,
> 
> Ferry van Steen
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail 
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to