Re: [PHP-DB] [PHP] Cannot connect to an MySQL database using Named Pipes (resolved)
I got as reply on another forum which resolved this issue. The command should be: $mysqli = new mysqli(., $username,$password, $database,null,/tmp/mysql.sock); NB. host is a dot bedul wrote: try run winmysqladmin.exe is there a posibility your mysql server got crash with unknown reason - Original Message - From: John Comerford [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, May 16, 2007 11:05 AM Subject: [PHP-DB] [PHP] Cannot connect to an MySQL database using Named Pipes Hi Folks, I have a MySQL database running on Windows XP, that I want to disable network connections to and enable 'named pipes'. I am running MySQL 5.0.27 and my.ini looks like... [client] #password= your_password port= 3306 socket= /tmp/mysql.sock [mysqld] #port= 3306 socket= /tmp/mysql.sock #Allow connections via named pipes (Windows NT+ only). Note: you can specify a pipe name on the advanced network page, if required. enable-named-pipe #Don't allow connections via TCP/IP. skip-networking I can connect to the DB using the MySQL GUI tools if I set my pipe name to '/tmp/mysql.sock' using the login dialog box. However when I try and connect using PHP I get an error. I have tried several variants of the connect command and I get various errors but all are along the lines of: Unknown MySQL server host '/tmp/mysql.sock' (11004) or Can't connect to MySQL server on 'localhost' (10061) I have tried $mysqli = new mysqli(null, $username,$password, $database); $mysqli = new mysqli(localhost:/tmp/mysql.sock, $username,$password, $database); $mysqli = new mysqli(localhost, $username,$password, $database,3306,/tmp/mysql.sock); $mysqli = new mysqli(localhost, $username,$password, $database,/tmp/mysql.sock); $mysqli = new mysqli(/tmp/mysql.sock, $username,$password, $database); ? $mysqli = new mysqli(localhost, my_user, my_password, world); /* check connection */ if (mysqli_connect_errno()) { printf(Connect failed: %s\n, mysqli_connect_error()); //exit(); } printf(Host information: %s\n, $mysqli-host_info); /* close connection */ $mysqli-close(); ? can u try above.. I got bad felling bout this?? I have also tried the above commands using mysqli_connect ? I have done a few searches of the web but seem to always come up with something like the above? Anybody have any ideas why it won't connect in PHP ? TIA, JC -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] [PHP] Cannot connect to an MySQL database using Named Pipes
Hi Folks, I have a MySQL database running on Windows XP, that I want to disable network connections to and enable 'named pipes'. I am running MySQL 5.0.27 and my.ini looks like... [client] #password= your_password port= 3306 socket= /tmp/mysql.sock [mysqld] #port= 3306 socket= /tmp/mysql.sock #Allow connections via named pipes (Windows NT+ only). Note: you can specify a pipe name on the advanced network page, if required. enable-named-pipe #Don't allow connections via TCP/IP. skip-networking I can connect to the DB using the MySQL GUI tools if I set my pipe name to '/tmp/mysql.sock' using the login dialog box. However when I try and connect using PHP I get an error. I have tried several variants of the connect command and I get various errors but all are along the lines of: Unknown MySQL server host '/tmp/mysql.sock' (11004) or Can't connect to MySQL server on 'localhost' (10061) I have tried $mysqli = new mysqli(null, $username,$password, $database); $mysqli = new mysqli(localhost:/tmp/mysql.sock, $username,$password, $database); $mysqli = new mysqli(localhost, $username,$password, $database,3306,/tmp/mysql.sock); $mysqli = new mysqli(localhost, $username,$password, $database,/tmp/mysql.sock); $mysqli = new mysqli(/tmp/mysql.sock, $username,$password, $database); I have also tried the above commands using mysqli_connect ? I have done a few searches of the web but seem to always come up with something like the above? Anybody have any ideas why it won't connect in PHP ? TIA, JC -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Fatal Error: Class 'mysqli' not found in...
Have you tried using phpinfo() to make sure it's seeing your php.ini file ? Ralph E. Brickley wrote: Hello All, I have been using Apache 2, PHP5 and MySQL 4 and 5 for a long time, and recently had to wipe my box due to a virus! Now that I have everything reinstalled, I can NOT get rid of this annoying MySQLi error. I have experienced this before but I can't seem to fix it this time. I have all of the necessary ini file settings, such as # Extension=php_mysqli.dll # Extension_dir = C:\PHP5\ext\ I do not get any errors on start up from Apache, but in trying to access mysqli I get this fatal error. I have lib_mysqli.dll all over this computer, Windows, System32, System, C:\PHP5, C:\PHP5\EXT\, everywhere. I'm stuck and need help. I uninstalled MySQL 5 and put 4.1 back on and that didn't help either. Any clues? Thanks! Ralph McMinnville -- 1^st Floor, 184 -186 Glenferrie Road, Malvern VIC 3144 PH:*(03) 9500 1466* FX :*(03) 9500 1469* Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Web: www.styleman.com.au http://www.styleman.com.au The information in this e-mail is confidential and is intended solely for the addressee. Any views or opinions presented are solely those of the author and do not necessarily represent those of Option Systems Pty Ltd. If you are not the intended recipient, please delete this message and contact the sender.
Re: [PHP-DB] simple issue
You'll have to supply more information a) code sample b) error message Chris Carter wrote: Hi, I am new to PHP, just trying a peace of code to access mySQL database to fetch and show result on web page. But getting errors. Can you help me with this code please. Or if you have a very basic code where in I can do some insertion in the database. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] simple issue
I'm pretty new to this stuff myself but try this: while ($row = $result-fetch_array()) { $compname=$row[CompanyName]; $conname=$row[ContactName]; echo trtd$compname/td; echo td$conname/td/tr; } Chris Carter wrote: my code: html body ? $username=chris; $password=carter; $database=chris_phpb1; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM phpbb_banlist; $result=mysql_query($query); if (!$result) {exit(Error in SQL);} echo tabletr; echo thCompanyname/th; echo thContactname/th/tr; while (odbc_fetch_row($result)) { $compname=odbc_result($result,CompanyName); $conname=odbc_result($result,ContactName); echo trtd$compname/td; echo td$conname/td/tr; } odbc_close($conn); echo /table; ? /body /html My error: Fatal error: Call to undefined function: odbc_fetch_row() in /home/chandan/public_html/deb.php on line 19 Companyname Contactname Also .. I am trying this live on cPanel compiler coz I could not install the PHP thing on my localhost. I have apache-tomcat-5.5.17 which works perfectly with jsp files but I do not understand what does it take to run a php using apache. chris smith-9 wrote: Chris Carter wrote: Hi, I am new to PHP, just trying a peace of code to access mySQL database to fetch and show result on web page. But getting errors. Can you help me with this code please. Or if you have a very basic code where in I can do some insertion in the database. There are hundreds of mysql + php tutorials on the 'net - do a search in your preferred search engine. If you *still* can't work it out post a sample of the code you're trying to use and the errors you get. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php