Finding specific column names

Hi,

Using PHP 4.4.4 and MySQL 5 (with an INNODB table), given Table A, how
can I programatically find all the columns in A that begin with the
string "file_path"?

Thanks, - Dave
laredotornado [ Sa, 09 Dezember 2006 23:37 ] [ ID #1562445 ]

Re: Finding specific column names

Should be what you're looking for:

SELECT * FROM tablea WHERE columna LIKE 'file_path%'

With "LIKE"

'x%' - starts with x
'%x' - ends with x
'%x%' - contains x

Sean

<laredotornado [at] zipmail.com> wrote in message
news:1165703841.453964.52110 [at] j44g2000cwa.googlegroups.com...
> Hi,
>
> Using PHP 4.4.4 and MySQL 5 (with an INNODB table), given Table A, how
> can I programatically find all the columns in A that begin with the
> string "file_path"?
>
> Thanks, - Dave
>
Sean [ Di, 12 Dezember 2006 09:53 ] [ ID #1565698 ]

Re: Finding specific column names

But surely that would give him a list of values in columna that begin
with file_path.

I think the OP needs to refer to
http://dev.mysql.com/doc/refman/5.0/en/columns-table.html


Sean wrote:
> Should be what you're looking for:
>
> SELECT * FROM tablea WHERE columna LIKE 'file_path%'
>
> With "LIKE"
>
> 'x%' - starts with x
> '%x' - ends with x
> '%x%' - contains x
>
> Sean
>
> <laredotornado [at] zipmail.com> wrote in message
> news:1165703841.453964.52110 [at] j44g2000cwa.googlegroups.com...
> > Hi,
> >
> > Using PHP 4.4.4 and MySQL 5 (with an INNODB table), given Table A, how
> > can I programatically find all the columns in A that begin with the
> > string "file_path"?
> >
> > Thanks, - Dave
> >
Captain Paralytic [ Di, 12 Dezember 2006 10:53 ] [ ID #1565699 ]

Re: Finding specific column names

Indeed you're right ... I misread.



"Captain Paralytic" <paul_lautman [at] yahoo.com> wrote in message
news:1165917181.933414.119590 [at] 73g2000cwn.googlegroups.com...
> But surely that would give him a list of values in columna that begin
> with file_path.
>
> I think the OP needs to refer to
> http://dev.mysql.com/doc/refman/5.0/en/columns-table.html
>
>
> Sean wrote:
>> Should be what you're looking for:
>>
>> SELECT * FROM tablea WHERE columna LIKE 'file_path%'
>>
>> With "LIKE"
>>
>> 'x%' - starts with x
>> '%x' - ends with x
>> '%x%' - contains x
>>
>> Sean
>>
>> <laredotornado [at] zipmail.com> wrote in message
>> news:1165703841.453964.52110 [at] j44g2000cwa.googlegroups.com...
>> > Hi,
>> >
>> > Using PHP 4.4.4 and MySQL 5 (with an INNODB table), given Table A, how
>> > can I programatically find all the columns in A that begin with the
>> > string "file_path"?
>> >
>> > Thanks, - Dave
>> >
>
Sean [ Di, 12 Dezember 2006 15:43 ] [ ID #1565702 ]
PHP » alt.php.sql » Finding specific column names

Vorheriges Thema: SQL Query Help needed
Nächstes Thema: Still getting #1064s!!!?!!?!!