note 66893 added to function.mysql-connect

From: Date: Wed, 31 May 2006 15:42:04 +0000
Subject: note 66893 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-112656@lists.php.net to get a copy of this message
Ever wonder what "default username" is? <?php $link = mysql_connect() or die(mysql_error()); $result = mysql_query("SELECT SESSION_USER(), CURRENT_USER();"); $row = mysql_fetch_row($result); echo "SESSION USER: ", $row[0], "<br>\n"; echo "CURRENT USER: ", $row[1], "<br>\n"; ?> Both are ODBC@localhost in my win2k install, so my advice for windows is: - create a MySQL user named ODBC with no password - add localhost to ODBC user [right-click ODBC] - set schema previleges to ODBC@localhost - use mysql_connect() with no parms, or do not use ;) This turns to work also with odbc_connect: odbc_connect("myDSN", "", "") ---- Server IP: 81.92.200.26 Probable Submitter: 213.22.112.233 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- http://master.php.net/note/edit/66893 Del: integrated -- http://master.php.net/note/delete/66893/integrated Del: useless -- http://master.php.net/note/delete/66893/useless Del: bad code -- http://master.php.net/note/delete/66893/bad+code Del: spam -- http://master.php.net/note/delete/66893/spam Del: non-english -- http://master.php.net/note/delete/66893/non-english Del: in docs -- http://master.php.net/note/delete/66893/in+docs Del: other reasons-- http://master.php.net/note/delete/66893 Reject -- http://master.php.net/note/reject/66893 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#112656) next »