Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I list MySQL table content dynamically? 2

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I need to query through a table and dump its content on screen. I normally do this by referencing the column names but in this case, users may add columns at will and the program should include these columns.

So, the table can have 3 columns today and 7 next week. How can this be done?

Thank you all in advance!

Regards,


 
i wrote a dynamic CRUD (create, read, update, delete) application for someone on this forum a wee while ago.
the code is in
thread434-1254677


 
jpadie,

I am getting an error:
Code:
Parse error: syntax error, unexpected '<' in C:\wamp\[URL unfurl="true"]www\dev\crud.php[/URL] on line 62

This is around the use of <<<EOL (forget how this is called).

Do I need something installed/init for this to work? I am running PHP 5.2.5

Thanks,
 
Ingresman,

thank you very much for the link ... it sure looks like a good starting point!

Regards,
 
no. heredoc syntax will work fine in that version of php.

make sure that you have not included any spaces or other text around the syntax. it hsould look like this:

Code:
$string = <<<EOL
 some text here
EOL;

there should be no characters after the identifier in the first line (EOL) and there must be NO characters either before or after the last line. characters, obviously, include spaces here.
 
jpadie,

Never mind ... I use DW and pasted your code to a new file w/in DW and it just did not work.

I opened my Notepad++, pasted it, saved it, tested it and IT works ...

Thanks!
 
you probably have auto-indent set in the code options of dreamweaver.

glad it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top