NameSilo

Need Help with SQL Wildcard!

SpaceshipSpaceship
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Watch

{insert name here}

Established Member
Impact
24
Hey guys, I need to run an sql update on my database.

Here one of the comands I need to run:

ALTER TABLE

_users ADD user_show_quickreply TINYINT(1) DEFAULT '1' NOT NULL ;

Now the problem is where the

is! I have to run this command for 524 tables all with differant prefixes, like me_users, you_users, extra.

Is there a wildcard that I can use to do this all at once, or am I going to be stuck creating each prefix manually!

D-:

 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
No there is no way without making an array and looping through it running the query for each array in php? There's no mysql wildcard for tables.
 
0
•••
How would I go about doing this, this seems like such a large task!

Thanks for the Help!

;)
 
0
•••
To be honest I would get rid of the tables how you have them and reform the table. Just from what you've told me I can tell it looks like it has been poorly developed. You can most likly combine all of those tables into one with a good amount of columns/rows rather than so many tables. It may be a lot of work but well worth it down the road.
 
0
•••
Well I cant do that, as they are for there own forums. I run a free forum host, and all the forums tables are created in the same database with differant prefixes. So I have to leave them the way they are, or have to rewrite the entire script, and at the point I am at right now, I would rather not! So I am going to be stuck inputing this all by hand it looks like! :(
 
0
•••
Well here's an idea. I've not used the free forum software before but you have it stored somewhere in a database of every user's table prefix correct? Why not query that and put every prefix into an array like I mentioned before and then just run the php script to dynamically do the alter to each table?
 
1
•••
Ill give that a try!

Thanks for the Help!

:tu:
 
0
•••
i see you are using the phpbb version of mf.

I actually created a mod for this which is available in the mf forum that can do this all you need to do is enter the sql
 
0
•••
Can you give me the url?

thank you!

:wave:
 
0
•••
filth said:
i see you are using the phpbb version of mf.

I actually created a mod for this which is available in the mf forum that can do this all you need to do is enter the sql

I went and looked for this mod you talked about, but could not find it!
Were would this mod be located?

Thanks
 
0
•••
0
•••
0
•••
no probs and thanks, since it was written I have got mainly good responses :>
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back