PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > General Forums > General Discussion

General Discussion General use discussion forum for PhotoPost products.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old September 25th, 2009, 11:58 AM   #1 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
Randomize Database User Connections

Until I get a dedicated server, I am only allowed 50 MySQL connections - per database users.

I can get around that, as suggested my my hosting support, to add more database users, and randomly connect to the DB with those different users.

Would anyone know how to randomize the connection process, for more users?
skidpics is offline   Reply With Quote
Old September 25th, 2009, 07:28 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
That would definately take a good deal of rewriting of the entire $link section here. As to what would need to be changed I have never personally looked at it.

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 26th, 2009, 12:27 AM   #3 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
Not for VB - just basic PP Pro
skidpics is offline   Reply With Quote
Old September 26th, 2009, 06:38 AM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
Right I am merely stating anything you do or code up would probally be centered around there as thats where we define the $link and $db_link lines.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 27th, 2009, 12:12 AM   #5 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
Quote:
Originally Posted by Chuck S View Post
Right I am merely stating anything you do or code up would probally be centered around there as thats where we define the $link and $db_link lines.
I basically need something like this:

$mysql_user1="vande11_user1";
$mysql_user2="vande11_user2";
$mysql_user3="vande11_user3;

$random_user = $mysql_user1, $mysql_user1, $mysql_user1

$mysql_user= $random_user

I am guessing this should work for each login.. as it will randomly select a differnet users based on the $random_user
skidpics is offline   Reply With Quote
Old September 27th, 2009, 12:26 AM   #6 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
I this should work..

$the_dbarray = array( "user1", "user2", "user3", "user3" ); //<--Note the extra "item3"
shuffle($the_dbarray);

$mysql_user = $the_dbarray

This should select 1 of the users# for a database connection, then pass the results to $mysql_user. Testing it, it is working. I would figure if there was an error, I would not be able to login ;-)

If only now I can base the random of Max_Sql connections, then it would work perfect.. for shared hosting, at this point in time.
skidpics is offline   Reply With Quote
Old September 27th, 2009, 06:32 AM   #7 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
yeah thats probally a very basic way to do it for your situation if your mysql password is the same for all users sure.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 27th, 2009, 08:57 AM   #8 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
Quote:
Originally Posted by Chuck S View Post
yeah thats probally a very basic way to do it for your situation if your mysql password is the same for all users sure.
True.

It would be nice the make it more of an

if .. else kinda thing, where it checks connections maxed out or not. I will keep looking for code snippets that will help me until such time as I move to a dedicated server. thanks..
skidpics is offline   Reply With Quote
Old September 27th, 2009, 12:34 PM   #9 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
yeah well if your host limits mysql connections to 50 per user sounds to me like you need a better host as thats even way more restrictive than powweb which I think is like 50000.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 27th, 2009, 05:21 PM   #10 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
You are right. I am on shared housting though - for now..

Bluehost has some good options, so I am in touch with them.. Powweb I haven't checked out yet - but will look into it.
skidpics is offline   Reply With Quote
Old September 27th, 2009, 05:28 PM   #11 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
No you dont want powweb.

Check out my host westhost.com
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 27th, 2009, 05:41 PM   #12 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
What's wrong with PowWeb?

Unlimited Space/ Unlimited data
skidpics is offline   Reply With Quote
Old September 27th, 2009, 05:47 PM   #13 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
well, Bluehost is out - 60 only and only shared hosting.
skidpics is offline   Reply With Quote
Old September 27th, 2009, 05:50 PM   #14 (permalink)
Ultimate Member
 
Join Date: Jun 2007
Posts: 1,340
well, the randomizing of users for the DB seemed to solve my problem 4 now...
skidpics is offline   Reply With Quote
Old September 27th, 2009, 06:20 PM   #15 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
Thats a good thing.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To many connections Error Issue?(NOT A BUG) grafx2g Photopost Pro Bug Reports 5 July 31st, 2010 06:37 PM
How Many MySQL Connections anthroa Photopost Pro How Do I...? 2 January 29th, 2007 12:32 AM
Update the database after a user has changed user name? marit Photopost Pro How Do I...? 8 June 16th, 2006 02:08 PM
Too many connections nightcrawler General Discussion 1 October 13th, 2005 08:25 AM


All times are GMT -5. The time now is 01:38 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0