RE: [PHP-DB] Re: mysql_connect
I might have missed the first of your posts and may be repeating someone else's suggestions but have you checked the hosts that the mysql user account that your are using can connect from the right areas. In the user table of the mysql database insure that the user account you are using has the proper rights to connect from 'localhost' and depending on your setup, that user may need access to connect from 'localhost.localdomain'. You could test if this may be the problem by giving that user account the value of '%' in the host column which would allow the user to connect from all hosts but do not leave it this way as you will be wide open for intrusion. BJH -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 8:27 PM To: Bryan McLemore; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: mysql_connect On 3 Sep 2002 at 23:00, Bryan McLemore wrote: - Original Message - From: David Robley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 9:31 PM Subject: [PHP-DB] Re: mysql_connect In article 000c01c253b2$506d7530$0101a8c0@fwcmain, [EMAIL PROTECTED] says... I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. BryanCan you show the code you are using, and any error messages you get? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Love the formatting by your mail pkg - OE of course :-) The code is $link = mysql_connect(localhost:3306, UserName, Password) or die(Could not connect); Thanks, Bryan McLemore May I suggest you keep the discussion on the mailing list - a) you have the entire list's expertise to draw on, b) the solution is shared with others who may benefit and c) you may get a quicker answer. Now, you haven't said so, but I assume you are getting 'Could not connect'? So, points to check: 1) mysql is running, and on port 3306; note that you don't need to specify the port usually 2) the username and password are correct - try the command line version to check that the user/pass are accepted (assuming you have command line access) 3) remove the 'or die' construct and see if you get an error message -- David Robley Temporary Kiwi! Quod subigo farinam My grape juice has fermented, Tom whined. -- 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
FW: [PHP-DB] Re: mysql_connect
Sorry, I think I orignially sent reply to wrong poster. That was confusing I might have missed the first of your posts and may be repeating someone else's suggestions but have you checked the hosts that the mysql user account that your are using can connect from the right areas. In the user table of the mysql database insure that the user account you are using has the proper rights to connect from 'localhost' and depending on your setup, that user may need access to connect from 'localhost.localdomain'. You could test if this may be the problem by giving that user account the value of '%' in the host column which would allow the user to connect from all hosts but do not leave it this way as you will be wide open for intrusion. BJH -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 8:27 PM To: Bryan McLemore; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: mysql_connect On 3 Sep 2002 at 23:00, Bryan McLemore wrote: - Original Message - From: David Robley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 9:31 PM Subject: [PHP-DB] Re: mysql_connect In article 000c01c253b2$506d7530$0101a8c0@fwcmain, [EMAIL PROTECTED] says... I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. BryanCan you show the code you are using, and any error messages you get? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Love the formatting by your mail pkg - OE of course :-) The code is $link = mysql_connect(localhost:3306, UserName, Password) or die(Could not connect); Thanks, Bryan McLemore May I suggest you keep the discussion on the mailing list - a) you have the entire list's expertise to draw on, b) the solution is shared with others who may benefit and c) you may get a quicker answer. Now, you haven't said so, but I assume you are getting 'Could not connect'? So, points to check: 1) mysql is running, and on port 3306; note that you don't need to specify the port usually 2) the username and password are correct - try the command line version to check that the user/pass are accepted (assuming you have command line access) 3) remove the 'or die' construct and see if you get an error message -- David Robley Temporary Kiwi! Quod subigo farinam My grape juice has fermented, Tom whined. -- 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
Re: [PHP-DB] Re: mysql_connect
Sorry about the private email didn't mean too. The email header shows you as it being from you and when I hit reply it defaults to go to you. Sorry bout that. Well on the goodside I got it fixed. Thanks for the feedback. The thing that got me was not having root has the user. Well thanks. Bryan - Original Message - From: David Robley [EMAIL PROTECTED] To: Bryan McLemore [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 05, 2002 8:26 PM Subject: Re: [PHP-DB] Re: mysql_connect On 3 Sep 2002 at 23:00, Bryan McLemore wrote: - Original Message - From: David Robley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 9:31 PM Subject: [PHP-DB] Re: mysql_connect In article 000c01c253b2$506d7530$0101a8c0@fwcmain, [EMAIL PROTECTED] says... I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. BryanCan you show the code you are using, and any error messages you get? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Love the formatting by your mail pkg - OE of course :-) The code is $link = mysql_connect(localhost:3306, UserName, Password) or die(Could not connect); Thanks, Bryan McLemore May I suggest you keep the discussion on the mailing list - a) you have the entire list's expertise to draw on, b) the solution is shared with others who may benefit and c) you may get a quicker answer. Now, you haven't said so, but I assume you are getting 'Could not connect'? So, points to check: 1) mysql is running, and on port 3306; note that you don't need to specify the port usually 2) the username and password are correct - try the command line version to check that the user/pass are accepted (assuming you have command line access) 3) remove the 'or die' construct and see if you get an error message -- David Robley Temporary Kiwi! Quod subigo farinam My grape juice has fermented, Tom whined. -- 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] Re: mysql_connect
In article 000c01c253b2$506d7530$0101a8c0@fwcmain, [EMAIL PROTECTED] says... I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. Bryan Can you show the code you are using, and any error messages you get? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_connect
try this. ?php $sqlhost = localhost; $sqluser = root; $sqlpasswd = password; $sqldatabase = test; //using pconnect to stay connect all the time to //close the connect use mysql_close($link); $link = mysql_pconnect($sqlhost,$sqluser,$sqlpasswd); mysql_select_db($sqldatabase); ? - Original Message - From: Bryan McLemore [EMAIL PROTECTED] Newsgroups: php.db To: PHP LIST [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 9:27 PM Subject: mysql_connect I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. Bryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_connect() and phpmyadmin
Dear Martin, Why don't you try this : ? $link = mysql_connect(localhost,phpcoder_dk,pdw ); if (!$link) { print(Connection fail); exit(); }else{ if (!mysql_select_db(phpcoder_dk,$link)) { print(Error); exit(); }else{ $query = SELECT * FROM hits; $result = mysql_query($query,$link); } } ? Please note that the IP address for localhost is 127.0.0.0 not 127.0.0.10. Regards, Noppanan Arunvongse Na Ayudhaya Martin Allan Jensen [EMAIL PROTECTED] wrote in message 005901c1b40d$6143c390$040a@IceSystems">news:005901c1b40d$6143c390$040a@IceSystems... I just don't understand why phpmyadmin works with it when i can't call it.! I did try with localhost but it won't still work.. PLEASE help i just can't understand it Kind regards Martin -Original Message- From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:44 AM To: Rick Emery Subject: Re: [PHP-DB] mysql_connect() It wasen't me hwo did it! but why do phpmyadmin work fine then?? Martin - Original Message - From: Rick Emery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 5:29 PM Subject: RE: [PHP-DB] mysql_connect() Re-read my previous email. You do not have mysql functionality compiled into PHP and you web server. The clue is the phrase undefined function: mysql_connect(). How did you load PHP, MYSQL, etc? -Original Message- From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:26 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql_connect() Sorry folks, last time i wrote it to fast! Well here is the hole story We got an organisation to install a new version of phpmyadmin, mySQL and PHP 4.0.6 on our Cobalt Raq 4r server (Linux) They got it installed and phpmyadmin is working finebut when i call fro a script souch as % ? // Connecting, selecting database $link = mysql_connect(127.0.0.10, phpcoder_dk, pdw) or die(Could not connect); print Connected successfully; mysql_select_db(phpcoder_dk) or die(Could not select database); // Performing SQL query $query = SELECT * FROM hits; $result = mysql_query($query) or die(Query failed); ? % The script writes this. % Fatal error: Call to undefined function: mysql_connect() in /home/sites/site2/web/sql.php on line 3 % You can test it at http://www.phpcoder.dk/sql.php I really hope that someone will help me cause i really can't find the problem by myself...! Kind regards Martin Allan Jensen -- 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] Re: mysql_connect() and phpmyadmin
Hi Martin! I dont think I understood your question right here. Are you trying to connect to mysql ? regards Raymond Martin Allan Jensen [EMAIL PROTECTED] wrote in message 005901c1b40d$6143c390$040a@IceSystems">news:005901c1b40d$6143c390$040a@IceSystems... I just don't understand why phpmyadmin works with it when i can't call it.! I did try with localhost but it won't still work.. PLEASE help i just can't understand it Kind regards Martin -Original Message- From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:44 AM To: Rick Emery Subject: Re: [PHP-DB] mysql_connect() It wasen't me hwo did it! but why do phpmyadmin work fine then?? Martin - Original Message - From: Rick Emery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 5:29 PM Subject: RE: [PHP-DB] mysql_connect() Re-read my previous email. You do not have mysql functionality compiled into PHP and you web server. The clue is the phrase undefined function: mysql_connect(). How did you load PHP, MYSQL, etc? -Original Message- From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:26 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql_connect() Sorry folks, last time i wrote it to fast! Well here is the hole story We got an organisation to install a new version of phpmyadmin, mySQL and PHP 4.0.6 on our Cobalt Raq 4r server (Linux) They got it installed and phpmyadmin is working finebut when i call fro a script souch as % ? // Connecting, selecting database $link = mysql_connect(127.0.0.10, phpcoder_dk, pdw) or die(Could not connect); print Connected successfully; mysql_select_db(phpcoder_dk) or die(Could not select database); // Performing SQL query $query = SELECT * FROM hits; $result = mysql_query($query) or die(Query failed); ? % The script writes this. % Fatal error: Call to undefined function: mysql_connect() in /home/sites/site2/web/sql.php on line 3 % You can test it at http://www.phpcoder.dk/sql.php I really hope that someone will help me cause i really can't find the problem by myself...! Kind regards Martin Allan Jensen -- 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