Welcome Guest, Not a member yet? Register   Sign In
i have retrived a table name from a query ,i want to select all values from that table name..its urgent
#1

[eluser]chellam[/eluser]
select * from (select name from temp_1 where name='temp_2') this query showing error


i have retrived the table name "temp_2"
i have the table "temp_2" already
i want to display the all values from that "temp_2"

please help me its urgent
#2

[eluser]Johan André[/eluser]
What does this have to do with Codeigniter?
You should probably spend some time reading up on SQL.

This is VERY basic and if you don't know it I don't think you will be able to code anything that uses a database.
#3

[eluser]chellam[/eluser]
if you know na then tell to others am a basic student only....otherwise do your work
#4

[eluser]chellam[/eluser]
provide me solution instead of declaring me useless
#5

[eluser]Johan André[/eluser]
First of all:
It's not about declaring you useless.

There are some thing you should be able to learn before asking questions, selecting data from a database table is one of them. If your question was about a complicated join and you tried alot of things it's another thing.
I think this forum should not be a place for complete beginners as most (well everything really) things can be read in the user guide.

But anyways, the syntax for selecting data from a table is:

SELECT column_name1, column_name2 ... FROM tablename
#6

[eluser]chellam[/eluser]
Dear jhon,
i guess u got confused ....
the question is actually

select * from table1
note:-table1 is the out put given by sub query "select name from temp_1 where name=‘table1’"

the idea behind this is that the table name that is table1 is dynamic which i have to retreive from database table ,which will have the collection of all tables names in the databse.




Theme © iAndrew 2016 - Forum software by © MyBB