Unable to select tables in MYSQL

Im trying to access the .albums table in MYSQL and when I say select * from albums;

It says table zenphoto.albums doesn't exist.

Tags:

Comments

  • acrylian Administrator, Developer
    edited September 2021

    You probably didn't look at your tables and missed the table prefix:

    Use Zenphoto's own functions for this like this:

    query_full_array("SELECT * FROM " . prefix('albums'));

    Depending on what you are trying to do, consider to use the object model instead to get data as there is some more context to things that you can achieve with direct queries.

  • I did look at the table prefix but it wouldnt help? The command SELECT * FROM .albums; would throw a syntax error. I looked into query_full_array in the docs and it was deleted?

  • acrylian Administrator, Developer

    Please post the full command you are using and escape it properly using backticks here in the forum. Otherwise your code will be truncated and unreadable like I assume SELECT * FROM .albums; above was (as that certainly would throw an error).

    I looked into query_full_array in the docs and it was deleted?

    No, it is not deleted. What you probably saw: Our doc generator cannot handle that we have a lot procedural functions with the same name in different function files. That generator does (and how should it) understand that only one is loaded at the time (depending on what db handler you are using) so this is not an issue and includes just one of them.

Sign In or Register to comment.