Jump to content

A constant for the SQL table prefix in the SQL toolbox


Michael

Recommended Posts

Posted

A lot of times we'll have to do things where we give people SQL queries to run to do things on their board. In those queries, the tables affected may or may not have a SQL table prefix on them, and if they do have one, it could be darn near anything. So if I give out a query to someone, the odds are pretty good they'll tell me they ran it and were told that table didn't exist. I then have to go into my spiel of explaining about SQL table prefixes.

What would be great would be if there was some constant that we could use in the queries we give people that the SQL toolbox would swap out with the table prefix on the board it is being run on.

So say we wanted to update all members to have a post count of 0. We could tell them to run a query like this:

UPDATE #PREFIX#members SET posts=0;


And then #PREFIX# would get swapped out with the SQL table prefix they use. That way, this query would always work.

Obviously this is a minor thing, and only beneficial for people who need to tell people queries to run against their site, but at the same time it should be a pretty easy thing to implement. ;)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...