[ postfixadmin-Bugs-3403116 ] mysqli_connect with ports
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2011-09-02 09:25:09
|
Bugs item #3403116, was opened at 2011-09-02 09:25 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3403116&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: mysqli_connect with ports Initial Comment: sry, this is the first bug I report, so apologies for bad form and language problems mysqli_connect needs the port as an extra parameter therefor writing 127.0.0.1:3307 doesn't work. The port either needs to be extracted from $CONF['database_host'] (where it is supposed to be following the setup.inc.php) or you use $CONF['database_port'] like you do for pgsql and change the description in setup.inc.php I took the first way, probably a bad choise, but I didn't know, if you had maybe any religous reasons to preserve $CONF['database_port'] for pgsql :) so essentialy I changed in functions.inc.php $link = @mysqli_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysqli_connect_error () . "$DEBUG_TEXT"); _to_ list($host, $givenPort) = explode(":", $CONF['database_host']); $port = (int) ($givenPort ? $givenPort : (ini_get("mysqli.default_port"))); $link = @mysqli_connect ($host, $CONF['database_user'], $CONF['database_password'], '', $port) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysqli_connect_error () . "$DEBUG_TEXT"); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3403116&group_id=191583 |