query to mysql with columns option

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
peterhall
Forum Newbie
Posts: 24
Joined: Sat Aug 21, 2010 5:47 pm

query to mysql with columns option

Post by peterhall »

Hi guys. I'm trying to make a query toi mysql dbase im php, but withou success. My table have aroun 20 columns, i want to make a query with rows and columns option, eg:

table1:

col1-----col2-----col3-----col4-----col5-----col6
r1a------r1b------r1c-------r1d------r1e------r1f
r2a------r2b------r2c-------r2d------r2e------r2f
r3a------r3b------r3c-------r3d------r3e------r3f
r4a------r4b------r4c-------r4d------r4e------r4f
r5a------r5b------r5c-------r5d------r5e------r5f
r6a------r6b------r6c-------r6d------r6e------r6f
r7a------r7b------r7c-------r7d------r7e------r7f

and now, with 3 combo, (one for the columns and 2 for the rows in the 2 first columns), i want to choose the data to retrieve... how can I get this?? :oops:

tku
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: query to mysql with columns option

Post by John Cartwright »

You might want to rephrase your question, because I have no idea what you are asking for.
peterhall
Forum Newbie
Posts: 24
Joined: Sat Aug 21, 2010 5:47 pm

Re: query to mysql with columns option

Post by peterhall »

0k. i'll try to be more explicit.

i have one table with 30 columns. the first 5 columns is the primary keys of the table, the rest is the information.

what i want, is filter by the first 5 columns, date (one, two or between dates), name, address, etc., and the remain columns, i want to choose wich ones i want to display, col6, col8, col9 and col14.

is it clear like this? can u understand it now? :roll:

tku for ur help!!!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: query to mysql with columns option

Post by Jonah Bron »

Read this tutorial, it'll probably help you.

http://www.w3schools.com/sql/sql_intro.asp
Post Reply