Jump to content

matfish

Members
  • Posts

    242
  • Joined

  • Last visited

Posts posted by matfish

  1. Hi,

     

    I've been redeveloping a website but every page I hit it creates a new Id in "Show Processlist" on the database. This being after viewing quite a few pages I then get the "Too many connections to database" error. I have dedicated server and connections are set to unlimited.

     

    This is obviously a coding issue. I require_once the connection.php script in the page header:

    global $config;
    global $db;
    
    $db = mysql_pconnect($config['db_hostname'], $config['db_user'], $config['db_password']);
    
    if (!$db){
    //@ include($config['site_root']."errors/500.php");
    echo "error: ".mysql_error();
    exit;
    }
      
    global $db_name;
    $db_name = $config['db_database'];
    $db_select = mysql_select_db($db_name);

     

    Do I have to mysql_close($result) after every query? Still doesnt seem to help.

     

    Any ideas?

     

    Many thanks

  2. Hi, I'm not great with Javascript/Ajax but I'v been using the below code in different places for a while now and it seems to work without any issues:

     

    function showList(nodeID) {
    	var xmlHttpReq = false;
    	var self = this;
    	var qstr = 'nodeID=' + (nodeID);
    
    	document.getElementById('item_' + nodeID).innerHTML = "  <img src='/images/ajax_spinner_grey.gif' alt='Please wait.' border='0'> Loading...";
    
    
    	if (window.XMLHttpRequest) {
    		self.xmlHttpReq = new XMLHttpRequest();
    	}else if (window.ActiveXObject) {
    		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    	}
    
    	self.xmlHttpReq.open('POST', 'item_list.php', true);
    	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
    		if (self.xmlHttpReq.readyState == 4) {
    			updatepage(self.xmlHttpReq.responseText, 'item_' + nodeID);
    		}
    	}
    
    
    	self.xmlHttpReq.send(qstr);
    
    }
    
    
    
    function updatepage(str, div){
    document.getElementById(div).innerHTML = str;
    }

     

    But I'm trying to fade the content which is updated in the .innerHTML so it looks a little "Flashy". Anyone have any ideas or point me in the right direction?

     

    Many thanks

     

     

  3. If mssql connect is sending a request and I can see it trying to hit the sql server but doesnt give an error message - is there a problem with the mssql_module?

     

    Many thanks

  4. Thing is... I'm not getting any error messages. I have checked our MSSQL database and its giving an error:

     

    17832 - Connection open but invalid login packets sent.

     

    I know the user/pass is correct as I'm running the same script on another server which is connecting without a problem.

     

    This only shows the echoed "Error:" and no actual error message
    $new = mssql_connect("[ip]:1433", "[username]", "[password]");
    if($new){ echo 'connected'; }
    else{ 
    echo 'Error: ';
    echo  mssql_get_last_message(); }

     

    Any help would be appreciated.

     

    Many thanks

  5. I have php-mssql module installed on our 1and1.com dedicated server and this works a treat when connecting to our local MSSQL in house server.

     

    I have recently changed hosting provider and installed the same module (need to install FREEtds too) but now I'm having trouble connecting when its exactly the same script.

     

    Any ideas? All firewall rules are open

  6. "apt-get install freetds" and then "apt-get install php-mssql" did the trick and overcome all dependencies. I restarted httpd and all works fine.

     

    Many thanks for your help.

  7. I've been using yum, this hicups the same dependancy errors. I then go though installing all sorts to rectify the errors. I thought I was getting somewhere then I get:

     

    Downloading Packages:
    freetds-0.64-1.el5.rf.i386.rpm                                                                            | 1.7 MB     00:03
    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
    
    Public key for php-mssql-5.1.6-4.el5.i386.rpm is not installed

     

    I've got Redhat 5 running - its a server with a hosting company who are unwilling to help.

    Any ideas?

  8. Hi, I need to install via SSH php-mssql module. I have "wget" the RPM but I'm getting the following error and I don't know how to resolve:

     

    [root@S0368-0577-WD01 rpm]# rpm -ivh php-mssql-5.1.6-4.el5.i386.rpm
    warning: php-mssql-5.1.6-4.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
    error: Failed dependencies:
            libsybdb.so.5 is needed by php-mssql-5.1.6-4.el5.i386
    

     

    Any help would be appreciated.

     

    Many thanks

  9. Splitting the table now is causing a few more problems than expected and I'm going to put it all together again I think. I'll have to bigdump it!

     

    Out of curiosity, would it have been possible to have done what I was trying to do?

     

    Many thanks

  10. The customers table was 290Mb, so was trying to archeive it into "years". I've been having alot of trouble with the table lately and I have to keep optimising/repairing it.

     

    If I could do the SQL to merge/join both tables then it would be easier. If not, then I will continue to use the whole table altogether again.

     

    Many thanks

  11. Hi there,

     

    I have split my customers table into customers_2008 and customers_2009. How would I do a mysql search on both tables (I'm using php to output the results)?

     

    I've looked into Joins but customers_2008.customerID = customers_2009.customerID is not going to work. I think a join is for foreign keys? Correct me if I'm using it wrong.

     

    Many thanks

  12. Hi, I'm having a little trouble.

     

    I'm moving a 280Mb database to a new server which consists of about 36 tables. As you can imagine phpMyadmin is having trouble with the export and import. I have found command line ways to backup the whole database but I was wondering if there is a way to backup individual tables and then import the individual tables via SSH?

     

    Many thanks

  13. Hi there,

     

    Is there any common reason why IE6 will crash when invoking javascript and/or ajax? It crashes without any errors or reasons. Works fine in IE7 and Firefox.

     

    Just wanted to see if there is a common issue before I go copying & pasting code for everyone to view.

     

    Many 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.