Jump to content

Staggan

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by Staggan

  1. Hello There are currently 5 databases.... I thought MySQL used to allow a restore that was additive... as in would append records to existing tables, if those tables existed... Ideally I want something that I can just name dbase 1 as source and dbase 2 as destination.... and add dbase 3 to that result...
  2. Hello I have multiple copies of a database schema, all with separate data... I now want to merge all of this data into one location... I have prepared all the individual databases so there is no clash of any unique ID's etc... but I cannot find anything that will allow me to append the data from one database to the other... For example.. I have a table called user and another called purchases... this table exists in each database... But now I want to merge that data into a single place... I know I can do it table by table, but that is slow and if anything goes wrong it could take a long time to resolve... Are there any automated tools I can use ? Thanks
  3. Originally It is was to do with server loading and regional latency, but we have introduced new systems to mitigate this to the point now where managing multiple user databases has become time consuming and problematic... My question is more about the implications of multiple connections to a MySQL database access the same tables at the same time... So, if I have one user table in a database and multiple connections to that database that act on that user table, what are the implications?
  4. Hello I am looking for information on allowing multiple instances of our application to access the same database... Currently we have each instance(generally a geographic region) of our application having its own database but this is proving problematic to manage... but if a user decides to install the application for another region all their user data is non existent in that region, so a new account must be created.. Ideally we would like to have a single user database for ALL instances (regions).... Is there any specific I need to do or consider to allow this? Thanks
  5. I have tried the above suggestion... This is what I do... function validateString($string) { $character_validation_pattern = '/\\A[\\x{00C0}-\\x{01FF}\\x{0600}-\\x{06FF}]+\\z/u'; if (preg_match($character_validation_pattern, $string)){ return true; } return false; }
  6. Can you clarify how this works for me? As I do not understand it... Thanks
  7. I appreciate your help, sorry, maybe I got a little confused with the answer... Let me explain a little more, perhaps it will help... Our app reads the latest news on login and displays it to the user, this news could be in a multitude of languages. We limit the characters for each language so that we can handle so many in a single app, a windows app, without ever needing to use windows font systems as they have a number of additional limitations. So, to put the news into the database we use a PHP page, but occasionally the person responsible for the news in a particular language manages to use a character we do not support.. which causes an issue.... Our app uses the ranges above which are the unicode numerical representation of the characters we allow...at least in Windows. I thought PHP might allow me a similar way to make the comparison, but it seems there is nothing quite that simple... As for your last point.. I see it, and can only assume it is an oversight somehow.. I will point it out... Thanks
  8. I have rechecked with our coders, and we actually compare characters with their unicode value to ensure they are within the ranges I specified in my first post.. So, how can I confirm that each character falls within one of those ranges in my first post?
  9. The unicode solution sounds possible.. Can you provide me some more information on that? Thanks
  10. We support several languages within our application and our font system has limitations. Those limitations include omitting some valid but less used characters to allow us to support so many languages in the way we do... BTW, this is not a web application, but the text is added via a web page...
  11. I thought I should explain a little more.. Our text is saved as UTF-8 into the database but several characters when imported to our application cause issues, the ellipsis being one of them, hence we check each character is within a specific range when imported. So, my question is still how do I get the hex value of a character in PHP... The rest is simple. Thanks
  12. I can't just get the hex code of each character? Or is this because the code changes depending on the encoding?
  13. Hello I have a PHP page that sends text entered by a user to our database which we use to display news. This system supports various languages but occasionally we get issues with odd characters being entered... For example, the premade glyph for ellipsis which is normally represented by 3 .'s broke our system today How can I check that each character is valid and within range? These are our character ranges ExtendedLatin_c_iLowerAlphaChar = 0x00C0; ExtendedLatin_c_iUpperAlphaChar = 0x01FF; Arabic_c_iLowerChar = 0x600; Arabic_c_iUpperChar = 0x6FF; Arabic_c_iLowerAlphaChar = 0x621; Arabic_c_iUpperAlphaChar = 0x64A; Arabic_c_iLowerNumericChar = 0x660; Arabic_c_iUpperNumericChar = 0x669; So each character must fall within one of these ranges... but I have no idea how to get the hex value of a character in PHP Thanks
  14. Doh! Thanks, wood for trees comes to mind..
  15. Doh! I have changed it to just encode the url now... but still the same error...
  16. Hello I am having an issue with encoding an array to JSON, my array seems to be formed correctly but when I try and echo the json_encode version I get "null". I echo the JSON error code and it is "0" indicating no issue.. I have read that non UTF-8 characters can be an issue, but this is simple data, no strange characters... but I added the utf8_encode anyway.... Here is my code: $dataArray = array( 'title' => 'Test Item', 'icon_url' => 'http://url/api/testimage.jpg', 'item_id' => '12345', 'expiration' => 600 ); utf8_encode($dataArray); $responsArray = array( 'success' => '1', 'data' => $dataArray ); utf8_encode($responsArray); header('Content-type: application/json'); echo print_r($responsArray); echo json_encode ($responseArray); echo json_last_error(); Any thoughts would be appreciated
  17. Hello I am looking for a way to log all incoming requests to a nusoap web service to a file.. any suggestions? Thanks
  18. Hello I have a nusoap web service running, which is fine, but I need to send a new variable in the parameters which decides what database to use... This is how I call the function: $params = array( 'region' => '1' ); $response1 = $client->call('function1', array ($params)); // response will be in JSON I use region to setup the database access.... but I do not want to have to setup the database access for each call.. I want to do it once in the server page... So, can I access 'region' at the beginning of my server page somehow? If that makes any sense...? Thanks
  19. Thank you for the quick replies and help.... works fine.
  20. We log a second record...
  21. Hello We have a database table that confirms the installations started and completed for our game... and I am looking to confirm how many installs start but never complete... So, this is my current query... SELECT description, ip from error_log where description like '%install%' order by ip; description can be either install started or install completed and we use the IP to identify a specific user... How do I query that shows the IP's which have a started but no completed in the description ? Any help would be appreciated Thanks
  22. Hello I am trying to work out how many regular users I have to my site and how long those users tend to be users.. So, I have a table that logs every time a user visits my site and logs in, it stores the date / time as a unix timestamp and it logs their user id. I started by getting the id's of any user who logs in more than 5 times in a specified period, but now I want to extend that... SELECT userID as user, count(userID) as logins FROM login_history where timestamp > UNIX_TIMESTAMP('2014-06-01 00:00:00') and timestamp < UNIX_TIMESTAMP('2014-07-01 00:00:00') group by user having logins > 5; So ideally a number of users in each month that visited over x times, users who visited at least x times for 3 months, 6 months, 9 months, 12 months.. Any suggestions would be appreciated Thanks
  23. Thank you... And sorry, I misread your original answer. I wanted to understand the reasoning, which you have now explained, so I will have to bite the bullet and amend the database to store the tokens for validation. Thanks again.
  24. Sorry, I am a little confused. We are not talking about passwords here, or overal site security, we have that. What we are talking about is an easily created and timestamped token to allow us to validate a request to change a password, without the need to store additional data in the database. Using the username and userid for a hash made sense as these are two known quantities that we can easily get once we have the username. Unless someone knows the userid for a specific user they will, hopefully, be unable to replicate the token and therefore be unlikely to use this to reset someone's password. Adding the timestamp then allows us to know when a request was made, and allows us to decide if it has expired. Encrypting the whole lot, using MCRYPT as Jacques suggested, then just makes the whole process of cracking the tokens to be able to reset someone's password that much harder... What am I missing?
  25. Thanks for the replies.. I think I have a solution, but would like some comments. When a user requests to change their password we ask for the username for their account... We then get the users email address, userid and current time from the database, and generate a token as below. md5 the username and userid, and then append the timestamp. We then use MCRYPT to encrypt the whole thing..... So now we have a token with an md5 of the username and userid, with the timestamp appended and all encrypted. This token is emailed along with a link to the user. The user then clicks the link and opens a page... This page, using MCRYPT, decripts the token, and removes the MD5 part of the token.. as all MD5 are 32 characters long... What we are left with is a valid timestamp.... We can then test the timestamp against the current server time and decide if it has expired... Thoughts? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.