Re: [PHP] mysql_connect noob question
Completely different function call(). mysql_connect() - the port is part of the host. *server* The MySQL server. It can also include a port number. e.g. hostname:port or a path to a local socket e.g. :/path/to/socket for the localhost. If the PHP directive mysql.default_hostitss://chm/res/mysql.configuration.html#ini.mysql.default-hostis undefined (default), then the default value is 'localhost:3306'. In SQL safe mode itss://chm/res/ini.core.html#ini.sql.safe-mode, this parameter is ignored and value 'localhost:3306' is always used. mysqli_connect() - the port is a parameter. I think you got the answers to the question you asked. On 23 April 2013 18:14, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/23/2013 10:39 AM, Glob Design Info wrote: Well all, it turns out the *correct* answer to my question, which no one answered, and which only degenerated into a kindergarten-like argument is: You need to add the port # to the *end* of the mysql_connect() call. i.e.: $link = mysqli_connect( $host, user, pass, $database, $port ); Glad to see the maturity level of posters on this list, as in most of IT these days is that of a bunch of squabling 5-year olds. On 4/23/13 5:47 AM, Tedd Sperling wrote: On Apr 21, 2013, at 3:33 PM, Glob Design Info i...@globdesign.com wrote: What question did I not answer? That proves that you're not listening -- you are total waste of time for anyone trying to help. Welcome to my ignore file. tedd _ tedd.sperl...@gmail.com http://sperling.com Tedd - you got off easy on this post. You should have seen the shouting tirade I received offline from this guy. What a putz! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Richard Quadling Twitter : @RQuadling EE : http://e-e.com/M_248814.html Zend : http://bit.ly/9O8vFY
Re: [PHP] mysql_connect noob question
On Apr 21, 2013, at 3:33 PM, Glob Design Info i...@globdesign.com wrote: What question did I not answer? That proves that you're not listening -- you are total waste of time for anyone trying to help. Welcome to my ignore file. tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Well all, it turns out the *correct* answer to my question, which no one answered, and which only degenerated into a kindergarten-like argument is: You need to add the port # to the *end* of the mysql_connect() call. i.e.: $link = mysqli_connect( $host, user, pass, $database, $port ); Glad to see the maturity level of posters on this list, as in most of IT these days is that of a bunch of squabling 5-year olds. On 4/23/13 5:47 AM, Tedd Sperling wrote: On Apr 21, 2013, at 3:33 PM, Glob Design Info i...@globdesign.com wrote: What question did I not answer? That proves that you're not listening -- you are total waste of time for anyone trying to help. Welcome to my ignore file. tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 4/23/2013 10:39 AM, Glob Design Info wrote: Well all, it turns out the *correct* answer to my question, which no one answered, and which only degenerated into a kindergarten-like argument is: You need to add the port # to the *end* of the mysql_connect() call. i.e.: $link = mysqli_connect( $host, user, pass, $database, $port ); Glad to see the maturity level of posters on this list, as in most of IT these days is that of a bunch of squabling 5-year olds. On 4/23/13 5:47 AM, Tedd Sperling wrote: On Apr 21, 2013, at 3:33 PM, Glob Design Info i...@globdesign.com wrote: What question did I not answer? That proves that you're not listening -- you are total waste of time for anyone trying to help. Welcome to my ignore file. tedd _ tedd.sperl...@gmail.com http://sperling.com Tedd - you got off easy on this post. You should have seen the shouting tirade I received offline from this guy. What a putz! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 4/21/2013 7:35 PM, Glob Design Info wrote: A very complex solution that takes time to learn, configure, and install, vs. a single file I can toss on the server. Over-engineering is what is daft. As has been pointed out to you - your simplistic approach to this task is going to cost you big-time down the road. When (and it will) the credentials to your mysql database get out and somebody(!) misuses them, you will be the one called to answer on this security breach. The last creds that you give out in an application are the keys to the kingdom. Your usage of the db access values should be confined to a script snippet that does the connecting for all scripts that seek data from the database. This snippet is included in those scripts from a folder that is outside of your webroot. Users have their own credentials that, once accepted, allow the user to make their requests. This is just such basic security practice, why can you not see it and accept the advice you are being given? As for why your connect statement doesn't work, that is truly a problem. I certainly don't know as much as the people on this group who have been trying to help you, but I know enough to listen to them and I know the basics of best security practices. You have spent two days trying to get answers to a question that shouldn't be answered. That's a slice of development time wasted. You need to backup, rework your db access and then simply change your current authentication script to use an ordinary user id and pswd that steers the users to a script that helps them access their data views without revealing to them the connect values. And personally, I think PHP is the best thing I've ever taken up since my first Univac assembler course back in 1971. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Sat, Apr 20, 2013 at 9:37 PM, Glob Design Info i...@globdesign.com wrote: Night now this is just a test server. On the real thing I'll do it right. On 4/20/13 10:58 AM, Tedd Sperling wrote: On Apr 20, 2013, at 11:44 AM, Stuart Dallas stu...@3ft9.com wrote: On 20 Apr 2013, at 16:25, Jim Giner jim.gi...@albanyhandball.com wrote: Why are you allowing anyone to connect to your database from a form? A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. I'm pretty sure that's not what tedd meant. The code is logging in to the database server using the username and password from the form. There are very few legitimate reasons to be doing this, so the question is well worth asking. -Stuart Stuart is exactly right. If you are checking someone's credentials to access your site, such as a user, then giving them the keys to the kingdom is a bit of an overkill. My advice, set up user_id and password fields in a user table for users you want to access some portion of your site, here's the code to do that: http://sperling.com/php/authorization/log-on.php Where I have said // define your user id here is the place to actually open your database and access your user table to gather the correct user_id and password. I also suggest that when you open the database you only use literals from a config.php file ($dbhost,$dbuser,$dbpass) for accessing the actual database and then check the user_id and password before giving them authorization to private areas. Keep the private stuff private! Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com That is a great point -- I was thinking this was a private app, but you should never ever ever ever ever ever (x infinity) allow wild wild web access to your database like this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Apr 21, 2013, at 9:32 AM, Stuart Dallas stu...@3ft9.com wrote: However, a more important question for me is why you are doing this. You say you are aware of the security implications, and that you'll deal with that later, but I question how you're going to deal with it. What exactly are you developing that requires DB credentials to come from a form on a web page? -Stuart You and I are asking the same question, but I am afraid the poster is not listening. Instead, he is pursuing a course of action that simply repeats his problem. His focus is on a specific tree instead of the forest. He doesn't want to widen his view. Until the poster answers our question, I'm afraid our recommendations will fall on deaf ears. Some days you can help and some days you can't. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling tedd.sperl...@gmail.com wrote: On Apr 21, 2013, at 9:32 AM, Stuart Dallas stu...@3ft9.com wrote: However, a more important question for me is why you are doing this. You say you are aware of the security implications, and that you'll deal with that later, but I question how you're going to deal with it. What exactly are you developing that requires DB credentials to come from a form on a web page? -Stuart You and I are asking the same question, but I am afraid the poster is not listening. Instead, he is pursuing a course of action that simply repeats his problem. His focus is on a specific tree instead of the forest. He doesn't want to widen his view. Until the poster answers our question, I'm afraid our recommendations will fall on deaf ears. Some days you can help and some days you can't. Cheers, tedd There's the Zen saying When the student is ready, the teacher appears. -- which to me says more about those attempting to teach than those attempting to learn. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 21 Apr 2013, at 15:46, tamouse mailing lists tamouse.li...@gmail.com wrote: On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling tedd.sperl...@gmail.com wrote: On Apr 21, 2013, at 9:32 AM, Stuart Dallas stu...@3ft9.com wrote: However, a more important question for me is why you are doing this. You say you are aware of the security implications, and that you'll deal with that later, but I question how you're going to deal with it. What exactly are you developing that requires DB credentials to come from a form on a web page? -Stuart You and I are asking the same question, but I am afraid the poster is not listening. Instead, he is pursuing a course of action that simply repeats his problem. His focus is on a specific tree instead of the forest. He doesn't want to widen his view. Until the poster answers our question, I'm afraid our recommendations will fall on deaf ears. Some days you can help and some days you can't. Cheers, tedd There's the Zen saying When the student is ready, the teacher appears. -- which to me says more about those attempting to teach than those attempting to learn. :) To me that means that you won't recognise the teacher until you're ready to learn. Teachers are always all around all of us, we just need to be willing to learn. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Sun, Apr 21, 2013 at 9:49 AM, Stuart Dallas stu...@3ft9.com wrote: On 21 Apr 2013, at 15:46, tamouse mailing lists tamouse.li...@gmail.com wrote: On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling tedd.sperl...@gmail.com wrote: On Apr 21, 2013, at 9:32 AM, Stuart Dallas stu...@3ft9.com wrote: However, a more important question for me is why you are doing this. You say you are aware of the security implications, and that you'll deal with that later, but I question how you're going to deal with it. What exactly are you developing that requires DB credentials to come from a form on a web page? -Stuart You and I are asking the same question, but I am afraid the poster is not listening. Instead, he is pursuing a course of action that simply repeats his problem. His focus is on a specific tree instead of the forest. He doesn't want to widen his view. Until the poster answers our question, I'm afraid our recommendations will fall on deaf ears. Some days you can help and some days you can't. Cheers, tedd There's the Zen saying When the student is ready, the teacher appears. -- which to me says more about those attempting to teach than those attempting to learn. :) To me that means that you won't recognise the teacher until you're ready to learn. Teachers are always all around all of us, we just need to be willing to learn. Yes, that is the intended meaning. My alternate means that teachers should not try to teach students who aren't ready. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, So, um, look at this gist: https://gist.github.com/tamouse/5430012 I know this never helps, but 'Works for me!' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
What question did I not answer? I am developing a web portal that has to display the tables in the DB via a form/script. The web page has a login with user and password. Right now I am just trying to connect. On Apr 21, 2013, at 7:12 AM, Tedd Sperling tedd.sperl...@gmail.com wrote: On Apr 21, 2013, at 9:32 AM, Stuart Dallas stu...@3ft9.com wrote: However, a more important question for me is why you are doing this. You say you are aware of the security implications, and that you'll deal with that later, but I question how you're going to deal with it. What exactly are you developing that requires DB credentials to come from a form on a web page? -Stuart You and I are asking the same question, but I am afraid the poster is not listening. Instead, he is pursuing a course of action that simply repeats his problem. His focus is on a specific tree instead of the forest. He doesn't want to widen his view. Until the poster answers our question, I'm afraid our recommendations will fall on deaf ears. Some days you can help and some days you can't. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Not meaning to beat the proverbial dead horse I am developing a web portal that has to display the tables in the DB via a form/script. The web page has a login with user and password. Right now I am just trying to connect. This for a commercial app - the client wants both an API connect via PHP and a web portal in which they can login from a web page and view the tables in the DB. Right now I am just trying to get the form/PHP interaction to work. This sounds like a very good use statement for http://www.phpmyadmin.net/http://www.phpmyadmin.net/home_page/ You can set it for http auth in the config ... they enter a mysql username and password and they only see the databases and tables you want them to see Might be easier than reinventing the wheel and stressing all of us :)
Re: [PHP] mysql_connect noob question
Except that a) I already have my form and script done, b) don't have time to learn phpMyAdmin, c) want to know why the script doesn't work as-is. On Apr 21, 2013, at 12:46 PM, David OBrien dgobr...@gmail.com wrote: Not meaning to beat the proverbial dead horse I am developing a web portal that has to display the tables in the DB via a form/script. The web page has a login with user and password. Right now I am just trying to connect. This for a commercial app - the client wants both an API connect via PHP and a web portal in which they can login from a web page and view the tables in the DB. Right now I am just trying to get the form/PHP interaction to work. This sounds like a very good use statement for http://www.phpmyadmin.net/ You can set it for http auth in the config ... they enter a mysql username and password and they only see the databases and tables you want them to see Might be easier than reinventing the wheel and stressing all of us :)
Re: [PHP] mysql_connect noob question
One other thing I noted in the FAQ was this: Dots in incoming variable names Typically, PHP does not alter the names of variables when they are passed into a script. However, it should be noted that the dot (period, full stop) is not a valid character in a PHP variable name. For the reason, look at it: ?php$varname.ext; /* invalid variable name */ ? Now, what the parser sees is a variable named $varname, followed by the string concatenation operator, followed by the barestring (i.e. unquoted string which doesn't match any known key or reserved words) 'ext'. Obviously, this doesn't have the intended result. For this reason, it is important to note that PHP will automatically replace any dots in incoming variable names with underscores. I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). On Apr 21, 2013, at 8:39 AM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, So, um, look at this gist: https://gist.github.com/tamouse/5430012 I know this never helps, but 'Works for me!'
Re: [PHP] mysql_connect noob question
On Sun, Apr 21, 2013 at 6:01 PM, Glob Design Info i...@globdesign.comwrote: One other thing I noted in the FAQ was this: Dots in incoming variable names Typically, PHP does not alter the names of variables when they are passed into a script. However, it should be noted that the dot (period, full stop) is not a valid character in a PHP variable name. For the reason, look at it: ?php $varname.ext; /* invalid variable name */ ? Now, what the parser sees is a variable named $varname, followed by the string concatenation operator, followed by the barestring (i.e. unquoted string which doesn't match any known key or reserved words) 'ext'. Obviously, this doesn't have the intended result. For this reason, it is important to note that PHP will automatically replace any dots in incoming variable names with underscores. I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). it's says variable NAMES not variable contents
Re: [PHP] mysql_connect noob question
On 21 Apr 2013, at 22:43, Glob Design Info i...@globdesign.com wrote: Except that a) I already have my form and script done, b) don't have time to learn phpMyAdmin, c) want to know why the script doesn't work as-is. You have multiple database users who will need to do this, or just one database user? If just one then it makes more sense to hard-code the username and password in the script and use something else like HTTP authentication to protect the script from unauthorised users. Giving internal database credentials to external users is generally a really really bad idea. Also, consider the time it will take to learn phpMyAdmin (it's simple - install, use) against the time it's taking to get your script working. The time you've spent developing the script is already sunk so there's no point sinking more in an effort to make that already-sunk time worthwhile. Also, how well tested is your script? I don't know but I can say with absolute confidence that phpMyAdmin has been tested far more. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ On Apr 21, 2013, at 12:46 PM, David OBrien dgobr...@gmail.com wrote: Not meaning to beat the proverbial dead horse I am developing a web portal that has to display the tables in the DB via a form/script. The web page has a login with user and password. Right now I am just trying to connect. This for a commercial app - the client wants both an API connect via PHP and a web portal in which they can login from a web page and view the tables in the DB. Right now I am just trying to get the form/PHP interaction to work. This sounds like a very good use statement for http://www.phpmyadmin.net/ You can set it for http auth in the config ... they enter a mysql username and password and they only see the databases and tables you want them to see Might be easier than reinventing the wheel and stressing all of us :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 21 Apr 2013, at 23:01, Glob Design Info i...@globdesign.com wrote: I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). This could be the culprit. Try using a username without an @ in it. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). I just created a free account there and the email says my username is dgobr...@gmail.com but I connected to it from sqlyog and a php page by using JUST dgobrien ?php $host = instance44364.db.xeround.com:3924; if ( $_REQUEST['Submit'] ) { $conn = mysql_connect( $host, $_REQUEST['username'], $_REQUEST['password'] ) or die( mysql_error() ); if ($conn) { mysql_select_db(uwharrie) or die( mysql_error() ); echo Connectedbr; } } ?form id='login' action='index.php' method='post' accept-charset='UTF-8' legendLogin/legend input type='hidden' name='submitted' id='submitted' value='1'/ label for='username' UserName*:/label input type='text' name='username' id='username' value='dgobrien' maxlength=50 / label for='password' Password*:/label input type='password' name='password' id='password' maxlength=50 value='mm' / input type='submit' name='Submit' value='Submit' / /form
Re: [PHP] mysql_connect noob question
In fact using the @gmail.com part added on gives me the same error as the OP I think their welcome email needs tweaking.. try it without the domain added on On Sun, Apr 21, 2013 at 6:56 PM, David OBrien dgobr...@gmail.com wrote: I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). I just created a free account there and the email says my username is dgobr...@gmail.com but I connected to it from sqlyog and a php page by using JUST dgobrien ?php $host = instance44364.db.xeround.com:3924; if ( $_REQUEST['Submit'] ) { $conn = mysql_connect( $host, $_REQUEST['username'], $_REQUEST['password'] ) or die( mysql_error() ); if ($conn) { mysql_select_db(uwharrie) or die( mysql_error() ); echo Connectedbr; } } ?form id='login' action='index.php' method='post' accept-charset='UTF-8' legendLogin/legend input type='hidden' name='submitted' id='submitted' value='1'/ label for='username' UserName*:/label input type='text' name='username' id='username' value='dgobrien' maxlength=50 / label for='password' Password*:/label input type='password' name='password' id='password' maxlength=50 value='mm' / input type='submit' name='Submit' value='Submit' / /form
Re: [PHP] mysql_connect noob question
Except that I want to use my script and form - precisely because I have already sunk time into it. I'm not going to sink *more* time into something that could potentially create *another* problem. I want the script to work - as it should if PHP is 1/2 what it's cracked up to be. If not, I'll have to look for another solution (like C which I have been using for 20 years). On 4/21/13 3:37 PM, Stuart Dallas wrote: On 21 Apr 2013, at 22:43, Glob Design Info i...@globdesign.com wrote: Except that a) I already have my form and script done, b) don't have time to learn phpMyAdmin, c) want to know why the script doesn't work as-is. You have multiple database users who will need to do this, or just one database user? If just one then it makes more sense to hard-code the username and password in the script and use something else like HTTP authentication to protect the script from unauthorised users. Giving internal database credentials to external users is generally a really really bad idea. Also, consider the time it will take to learn phpMyAdmin (it's simple - install, use) against the time it's taking to get your script working. The time you've spent developing the script is already sunk so there's no point sinking more in an effort to make that already-sunk time worthwhile. Also, how well tested is your script? I don't know but I can say with absolute confidence that phpMyAdmin has been tested far more. -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Tried that. Still didn't work. I appears to be the port. On 4/21/13 3:40 PM, Stuart Dallas wrote: On 21 Apr 2013, at 23:01, Glob Design Info i...@globdesign.com wrote: I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). This could be the culprit. Try using a username without an @ in it. -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
SUCCESS! However. if ( $_REQUEST['Submit'] ) { makes it work (using my own form button ID). Why it doesn't work without this on my machine is beyond me. But it doesn't. Could it be somehow there is something about accessing the $_REQUEST that changes something? I am baffled as to the cause, but anyway it does work now. Thanks for your help. On 4/21/13 3:56 PM, David OBrien wrote: I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). I just created a free account there and the email says my username is dgobr...@gmail.com but I connected to it from sqlyog and a php page by using JUST dgobrien ?php $host = instance44364.db.xeround.com:3924; if ( $_REQUEST['Submit'] ) { $conn = mysql_connect( $host, $_REQUEST['username'], $_REQUEST['password'] ) or die( mysql_error() ); if ($conn) { mysql_select_db(uwharrie) or die( mysql_error() ); echo Connectedbr; } } ?form id='login' action='index.php' method='post' accept-charset='UTF-8' legendLogin/legend input type='hidden' name='submitted' id='submitted' value='1'/ label for='username' UserName*:/label input type='text' name='username' id='username' value='dgobrien' maxlength=50 / label for='password' Password*:/label input type='password' name='password' id='password' maxlength=50 value='mm' / input type='submit' name='Submit' value='Submit' / /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Even more strange: It doesn't work from the form with or without the domain (but on the command line it does), but.. IF I add the $_REQUEST access *and* use the user that the *MySQL* install has, and *not* the xeround user name (my email), then it *does* work! WEIRD. On 4/21/13 3:59 PM, David OBrien wrote: In fact using the @gmail.com part added on gives me the same error as the OP I think their welcome email needs tweaking.. try it without the domain added on On Sun, Apr 21, 2013 at 6:56 PM, David OBrien dgobr...@gmail.com wrote: I should note my user name in this case *is* an email address, however the dots in that address are *not* being converted to underscores as mentioned (at least not visibly). I just created a free account there and the email says my username is dgobr...@gmail.com but I connected to it from sqlyog and a php page by using JUST dgobrien ?php $host = instance44364.db.xeround.com:3924; if ( $_REQUEST['Submit'] ) { $conn = mysql_connect( $host, $_REQUEST['username'], $_REQUEST['password'] ) or die( mysql_error() ); if ($conn) { mysql_select_db(uwharrie) or die( mysql_error() ); echo Connectedbr; } } ?form id='login' action='index.php' method='post' accept-charset='UTF-8' legendLogin/legend input type='hidden' name='submitted' id='submitted' value='1'/ label for='username' UserName*:/label input type='text' name='username' id='username' value='dgobrien' maxlength=50 / label for='password' Password*:/label input type='password' name='password' id='password' maxlength=50 value='mm' / input type='submit' name='Submit' value='Submit' / /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 22 Apr 2013, at 00:16, Glob Design Info i...@globdesign.com wrote: Except that I want to use my script and form - precisely because I have already sunk time into it. I'm not going to sink *more* time into something that could potentially create *another* problem. The idea of sunk time is that it's already been spent, so spending more in an attempt to justify the fact you spent it (i.e. to make it work because it's already cost you time/money) is daft when you discover a pre-built solution. To refuse to investigate it due to a refusal to throw the result of that time away is pure stubbornness, a normally expensive path to walk. I want the script to work - as it should if PHP is 1/2 what it's cracked up to be. If not, I'll have to look for another solution (like C which I have been using for 20 years). Am I supposed to care whether you use PHP or not? But sure, let me know how much time it takes you to write a web-based MySQL management tool in C. In the meantime I'll install phpMyAdmin in five minutes, show it to your client, and probably not even charge them for it. C? Really? Why not assembly language, since the relationship between PHP and C is the same as that between assembly and C? Hell, take it all the way to punch cards if you want -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
A very complex solution that takes time to learn, configure, and install, vs. a single file I can toss on the server. Over-engineering is what is daft. On 4/21/13 4:33 PM, Stuart Dallas wrote: On 22 Apr 2013, at 00:16, Glob Design Info i...@globdesign.com wrote: Except that I want to use my script and form - precisely because I have already sunk time into it. I'm not going to sink *more* time into something that could potentially create *another* problem. The idea of sunk time is that it's already been spent, so spending more in an attempt to justify the fact you spent it (i.e. to make it work because it's already cost you time/money) is daft when you discover a pre-built solution. To refuse to investigate it due to a refusal to throw the result of that time away is pure stubbornness, a normally expensive path to walk. I want the script to work - as it should if PHP is 1/2 what it's cracked up to be. If not, I'll have to look for another solution (like C which I have been using for 20 years). Am I supposed to care whether you use PHP or not? But sure, let me know how much time it takes you to write a web-based MySQL management tool in C. In the meantime I'll install phpMyAdmin in five minutes, show it to your client, and probably not even charge them for it. C? Really? Why not assembly language, since the relationship between PHP and C is the same as that between assembly and C? Hell, take it all the way to punch cards if you want -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Ever heard of the MySQL C Connector? http://www.karlkraft.com/index.php/2010/06/02/mysql-and-objective-c/ :-) On 4/21/13 4:33 PM, Stuart Dallas wrote: On 22 Apr 2013, at 00:16, Glob Design Info i...@globdesign.com wrote: Except that I want to use my script and form - precisely because I have already sunk time into it. I'm not going to sink *more* time into something that could potentially create *another* problem. The idea of sunk time is that it's already been spent, so spending more in an attempt to justify the fact you spent it (i.e. to make it work because it's already cost you time/money) is daft when you discover a pre-built solution. To refuse to investigate it due to a refusal to throw the result of that time away is pure stubbornness, a normally expensive path to walk. I want the script to work - as it should if PHP is 1/2 what it's cracked up to be. If not, I'll have to look for another solution (like C which I have been using for 20 years). Am I supposed to care whether you use PHP or not? But sure, let me know how much time it takes you to write a web-based MySQL management tool in C. In the meantime I'll install phpMyAdmin in five minutes, show it to your client, and probably not even charge them for it. C? Really? Why not assembly language, since the relationship between PHP and C is the same as that between assembly and C? Hell, take it all the way to punch cards if you want -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 22 Apr 2013, at 00:35, Glob Design Info i...@globdesign.com wrote: A very complex solution that takes time to learn, configure, and install, vs. a single file I can toss on the server. Over-engineering is what is daft. Building your house by making your own bricks is daft. Using bricks somebody else has built is not. Or, if it makes more sense substitute a car and inventing wheels. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 22 Apr 2013, at 00:36, Glob Design Info i...@globdesign.com wrote: Ever heard of the MySQL C Connector? http://www.karlkraft.com/index.php/2010/06/02/mysql-and-objective-c/ That would be Objective-C, not C. I have used libmysqlclient extensively, but there's a lot more to a MySQL management tool than connecting to a MySQL server and running queries. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
After all this, the OP remains unenlightened. This is just a waste of time. You are doing this wrong. There are existing tools that do what your client wants. A command line tool is not the same as the php library. are all met with I don't want to learn, just tell me what isn't working. Too bad.
Re: [PHP] mysql_connect noob question
No, that's for writing safe html output. If the user or password contains special chars, sending them through htmlspecialchars would turn them into html entities. i doubt you want that. I'm at a loss here. The only thing Ican think of is to try something like this at the top of the script: ?php error_reporting(-1); ini_set('display_errors',1); ini_set('display_startup_errors',1); header(Content-type: text/plain); var_dump($_POST); exit; ? and see precisely what is being passed in from your form. On Apr 19, 2013 10:50 PM, Glob Design Info i...@globdesign.com wrote: No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Sat, Apr 20, 2013 at 10:36 AM, tamouse mailing lists tamouse.li...@gmail.com wrote: No, that's for writing safe html output. If the user or password contains special chars, sending them through htmlspecialchars would turn them into html entities. i doubt you want that. I'm at a loss here. Pretty much the same goes for me. It could be charset issue, do your username and password consist of only ASCII characters, or do they also contain others? If so, then it might be that your sending these characters in a different charset. - Matijn
Re: [PHP] mysql_connect noob question
Thanks for that good suggestion. I tried that and as expected, the passed variables are coming through exactly as expected: array(3) { [user]= string(3) joe [password]= string(11) complacency [login]= string(5) Login } The bottom one seems to be the submit button's tag. I'm at a loss too. It should work. Replacing all 3 script variables with hard-coded values for the login works fine - so I know the host string is fine. Very weird! On 4/20/13 1:36 AM, tamouse mailing lists wrote: No, that's for writing safe html output. If the user or password contains special chars, sending them through htmlspecialchars would turn them into html entities. i doubt you want that. I'm at a loss here. The only thing Ican think of is to try something like this at the top of the script: ?php error_reporting(-1); ini_set('display_errors',1); ini_set('display_startup_errors',1); header(Content-type: text/plain); var_dump($_POST); exit; ? and see precisely what is being passed in from your form. On Apr 19, 2013 10:50 PM, Glob Design Info i...@globdesign.com wrote: No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Goog suggestion. The user name is an email address so it does contain @. Password is all pure lowercase ASCII. Wonder if the shift-2 is causing the problem? On 4/20/13 4:44 AM, Matijn Woudt wrote: On Sat, Apr 20, 2013 at 10:36 AM, tamouse mailing lists tamouse.li...@gmail.com wrote: No, that's for writing safe html output. If the user or password contains special chars, sending them through htmlspecialchars would turn them into html entities. i doubt you want that. I'm at a loss here. Pretty much the same goes for me. It could be charset issue, do your username and password consist of only ASCII characters, or do they also contain others? If so, then it might be that your sending these characters in a different charset. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Apr 19, 2013, at 4:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, Why are you allowing anyone to connect to your database from a form? Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
$form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Have you tried $LINK = mysql_connect( $host, $form_user, $form_pass ); just for the heck of it?
Re: [PHP] mysql_connect noob question
Why are you allowing anyone to connect to your database from a form? Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 20 Apr 2013, at 16:25, Jim Giner jim.gi...@albanyhandball.com wrote: Why are you allowing anyone to connect to your database from a form? A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. I'm pretty sure that's not what tedd meant. The code is logging in to the database server using the username and password from the form. There are very few legitimate reasons to be doing this, so the question is well worth asking. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 4/20/2013 11:44 AM, Stuart Dallas wrote: On 20 Apr 2013, at 16:25, Jim Giner jim.gi...@albanyhandball.com wrote: Why are you allowing anyone to connect to your database from a form? A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. I'm pretty sure that's not what tedd meant. The code is logging in to the database server using the username and password from the form. There are very few legitimate reasons to be doing this, so the question is well worth asking. -Stuart oops - now I see. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Same error. That just turns those into string literals. On 4/20/13 5:48 AM, David OBrien wrote: $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Have you tried $LINK = mysql_connect( $host, $form_user, $form_pass ); just for the heck of it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Apr 20, 2013, at 11:44 AM, Stuart Dallas stu...@3ft9.com wrote: On 20 Apr 2013, at 16:25, Jim Giner jim.gi...@albanyhandball.com wrote: Why are you allowing anyone to connect to your database from a form? A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. I'm pretty sure that's not what tedd meant. The code is logging in to the database server using the username and password from the form. There are very few legitimate reasons to be doing this, so the question is well worth asking. -Stuart Stuart is exactly right. If you are checking someone's credentials to access your site, such as a user, then giving them the keys to the kingdom is a bit of an overkill. My advice, set up user_id and password fields in a user table for users you want to access some portion of your site, here's the code to do that: http://sperling.com/php/authorization/log-on.php Where I have said // define your user id here is the place to actually open your database and access your user table to gather the correct user_id and password. I also suggest that when you open the database you only use literals from a config.php file ($dbhost,$dbuser,$dbpass) for accessing the actual database and then check the user_id and password before giving them authorization to private areas. Keep the private stuff private! Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Night now this is just a test server. On the real thing I'll do it right. On 4/20/13 10:58 AM, Tedd Sperling wrote: On Apr 20, 2013, at 11:44 AM, Stuart Dallas stu...@3ft9.com wrote: On 20 Apr 2013, at 16:25, Jim Giner jim.gi...@albanyhandball.com wrote: Why are you allowing anyone to connect to your database from a form? A little OT, but... What do you mean by this question? How do you check someone's credentials if not by connecting to a db to verify the login? Cause I'm doing the same kind of thing all over the place. With good practices on validation and such before doing my query of course. I'm pretty sure that's not what tedd meant. The code is logging in to the database server using the username and password from the form. There are very few legitimate reasons to be doing this, so the question is well worth asking. -Stuart Stuart is exactly right. If you are checking someone's credentials to access your site, such as a user, then giving them the keys to the kingdom is a bit of an overkill. My advice, set up user_id and password fields in a user table for users you want to access some portion of your site, here's the code to do that: http://sperling.com/php/authorization/log-on.php Where I have said // define your user id here is the place to actually open your database and access your user table to gather the correct user_id and password. I also suggest that when you open the database you only use literals from a config.php file ($dbhost,$dbuser,$dbpass) for accessing the actual database and then check the user_id and password before giving them authorization to private areas. Keep the private stuff private! Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect noob question
I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info i...@globdesign.comwrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, Try printing the $form_user and form_pass values, it might be that it's just an error elsewhere, maybe field name is different in the html? Otherwise, it might be you have some php init setting, like magic quotes that does something with the input data. - Matijn
Re: [PHP] mysql_connect noob question
Already did that. I printed the form values in the PHP script after they are received and they print exactly as entered in the form. Even checked for extra spaces. Any functions I can pass the values to to remove the magic quotes? Thanks, On 4/19/13 1:47 PM, Matijn Woudt wrote: On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info i...@globdesign.comwrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, Try printing the $form_user and form_pass values, it might be that it's just an error elsewhere, maybe field name is different in the html? Otherwise, it might be you have some php init setting, like magic quotes that does something with the input data. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On Fri, Apr 19, 2013 at 10:59 PM, Glob Design Info i...@globdesign.comwrote: Already did that. I printed the form values in the PHP script after they are received and they print exactly as entered in the form. Even checked for extra spaces. Any functions I can pass the values to to remove the magic quotes? Thanks, You would see the quotes if they were there in the output. There's no reason why it should not work this way, though I doubt it's safe to do. Can you show us the rest of the code, including the HTML form? And exactly what error are you getting? (eg. from mysql_error()) On 4/19/13 1:47 PM, Matijn Woudt wrote: On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, Try printing the $form_user and form_pass values, it might be that it's just an error elsewhere, maybe field name is different in the html? Otherwise, it might be you have some php init setting, like magic quotes that does something with the input data. - Matijn
Re: [PHP] mysql_connect noob question
On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Nope, quotes are not visible in the output. Both the HTML and the script it calls are shown below. They are in 2 separate files. The variable names in both are user and password. The data comes through to the PHP script fine - if I print them I see exactly what I typed in the form, but when I pass them to my DB host on another server via mysql_connect it give me an error. HTML: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleAdmin/title style type=text/css .desw { font-family: Arial, Helvetica, sans-serif; } /style /head body div align=center pnbsp;/p pimg src=../images/web_logo_admin.png alt=0 width=221 height=134 border=0 //p p class=deswnbsp;/p p class=deswstrongPlease log in./strong/p p class=deswnbsp;/p form id=form1 name=form1 action=../wservices/connect.php method=post pUser: input type=text name=user id=user //p pPassword: input type=password name=password id=password //p pinput type=submit name=login id=login value=Login //p /form p class=deswnbsp;/p p class=deswnbsp;/p /div pnbsp;/p pnbsp;/p /body /html PHP: ?php # Add redirect page for errors header( Location: ../admin/login_error.html ); # Server info $host = instance43490.db.xeround.com:8904; # Get user pass from input form $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; echo pUser: . $form_user . /p; echo pPass: . $form_pass . /p; # Connect to remote DB $WSDB_LINK = mysql_connect( $host, $form_user, $form_pass ); if( !$WSDB_LINK ) { error_log( NeverStranded: cannot connect to the database. ); } else { .. } ? On 4/19/13 2:13 PM, Matijn Woudt wrote: On Fri, Apr 19, 2013 at 10:59 PM, Glob Design Info i...@globdesign.comwrote: Already did that. I printed the form values in the PHP script after they are received and they print exactly as entered in the form. Even checked for extra spaces. Any functions I can pass the values to to remove the magic quotes? Thanks, You would see the quotes if they were there in the output. There's no reason why it should not work this way, though I doubt it's safe to do. Can you show us the rest of the code, including the HTML form? And exactly what error are you getting? (eg. from mysql_error()) On 4/19/13 1:47 PM, Matijn Woudt wrote: On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); And yes, my $host param is correct. Thanks, Try printing the $form_user and form_pass values, it might be that it's just an error elsewhere, maybe field name is different in the html? Otherwise, it might be you have some php init setting, like magic quotes that does something with the input data. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. -- Cheers David Robley A man's best friend is his dogma. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
On 4/20/2013 12:23 AM, Glob Design Info wrote: No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Why does the error message refer to mysql-connect and not mysql_connect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect noob question
Dunno. The code definitely has the underscore. On Apr 19, 2013, at 9:11 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/20/2013 12:23 AM, Glob Design Info wrote: No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 4/19/2013 9:33 PM, Glob Design Info wrote: They aren't on the same server. The DB is on xeround.com, the web server is localhost. The host value is set and working. If I hard-code the user and password values in the mysql_connect() call and leave the host value as is, it connects fine. Only passing the user and password from the form cause it to fail. On 4/19/13 5:47 PM, David Robley wrote: Glob Design Info wrote: Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect http://localhost/wservices/function.mysql-connect]: Access denied for user 'user'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But with the real user name, not just 'user') Thanks, On 4/19/13 3:28 PM, tamouse mailing lists wrote: On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info i...@globdesign.com wrote: I know this has probably been answered already. When I pass a user name and password from a form to my PHP script and then pass those to mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as string literals it works. Can anyone tell me why this happens? I know the strings are identical to the literals I try in a test but they don't work when submitted via form. $form_user = $_POST[ 'user' ]; $form_pass = $_POST[ 'password' ]; # Connect to remote DB $LINK = mysql_connect( $host, $form_user, $form_pass ); Please show the error you are getting from the mysql_connect And yes, my $host param is correct. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php First guess is that you don't have privileges for 'user'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 'user'. And, what are you using for the $host value? If the script and mysql are on the same server, it shouldn't need to be anything other than 'localhost'. Do your user or password contain spaces, thereby requiring quotes in your call? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Why does the error message refer to mysql-connect and not mysql_connect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect slowness
Hi Waynn! have you ever tried using 1. sql_cache SELECT SQL_CACHE * FROM table .. I use this alot... although you have to have mysql cache enable in the sql config file... your webhost can tell you if it is on or not 2. make indexes for your tables here is a good article http://www.databasejournal.com/features/mysql/article.php/1382791 a great admin program to use is Navicat... it's very easy to make your indexes there... Hopefully those 2 suggestions speed up things a little! :o) let us know if it works Joe On Mon, Apr 28, 2008 at 12:14 AM, Waynn Lue [EMAIL PROTECTED] wrote: Our site has been slowing down dramatically in the last few days, so I've been trying to figure out why. I ran some profiling scripts on our site and saw that we're spending between 3-9 seconds on mysql_connect. Then I connected to our db and saw that there were over 100 connections at the time, most of them sleeping. Is this because we don't close mysql connections until the end of script execution? How do people generally structure their code to minimize the time they keep mysql connections open? Currently all db connections go through one file, which gets included at the top of the file. One other question, is it better to open one connection, then re-use it later, or just continually open and close per db call? Thanks, Waynn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect slowness
Waynn Lue wrote: Our site has been slowing down dramatically in the last few days, so I've been trying to figure out why. I ran some profiling scripts on our site and saw that we're spending between 3-9 seconds on mysql_connect. Then I connected to our db and saw that there were over 100 connections at the time, most of them sleeping. Is this because we don't close mysql connections until the end of script execution? How do people generally structure their code to minimize the time they keep mysql connections open? Currently all db connections go through one file, which gets included at the top of the file. One other question, is it better to open one connection, then re-use it later, or just continually open and close per db call? Thanks, Waynn Hi Waynn, I've done some tuning on MySQL last year after having similar problems. They are not all gone, but they are reduced to a minimum. I've read the following URL's to get some hints and tips: www dot databasejournal dot com/features/mysql/print.php/10897_1402311_3 www dot t-scripts dot com/mysql/ mysqldatabaseadministration dot blogspot dot com/2005/11/mysql-5-optimization-and-tuning-guide.html (I'm sorry that these URL's are not allowed due to SURBL policies, replace 'dot' with the appropiate character) It boils down to tuning your my.cnf with some altered parameters and checking the status in MySQL. It depends on how much memory is in use, how many tables you want to have open and how many connection you expect within certain periods etc. You can gain a lot with doing this. Having sleeping processes / connections is because it doesn't have a hard timeout and MySQL sometimes forgets to kill these processes. But this is because of the load. When the load decreases, MySQL is better being able to keep up with the processes. -- Aschwin Wesselius 'What you would like to be done to you, do that to the other' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect slowness
Our site has been slowing down dramatically in the last few days, so I've been trying to figure out why. I ran some profiling scripts on our site and saw that we're spending between 3-9 seconds on mysql_connect. Then I connected to our db and saw that there were over 100 connections at the time, most of them sleeping. Is this because we don't close mysql connections until the end of script execution? How do people generally structure their code to minimize the time they keep mysql connections open? Currently all db connections go through one file, which gets included at the top of the file. One other question, is it better to open one connection, then re-use it later, or just continually open and close per db call? Thanks, Waynn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect slowness
Waynn Lue wrote: Our site has been slowing down dramatically in the last few days, so I've been trying to figure out why. I ran some profiling scripts on our site and saw that we're spending between 3-9 seconds on mysql_connect. Then I connected to our db and saw that there were over 100 connections at the time, most of them sleeping. Is this because we don't close mysql connections until the end of script execution? Are you using mysql_pconnect or just mysql_connect? Persistent connections do what you outline and keep the connection sitting there. For this (and some other reasons) most people don't use persistent connections. PHP should clean up regular _connect resources when the script(s) are finished running, you don't need to do it explicitly. How do people generally structure their code to minimize the time they keep mysql connections open? Currently all db connections go through one file, which gets included at the top of the file. One other question, is it better to open one connection, then re-use it later, or just continually open and close per db call? It'll be even slower to open/close per db call. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [?? Probable Spam] [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT
As you didn't mentioned what you use your queries for, maybe read the manual? Andy Juanjo Pascual wrote: How can i know which of both is better to use each time? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MYSQL_CONNECT vs MYSQL_PCONNECT
How can i know which of both is better to use each time? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT
On Tue, 2006-06-20 at 12:34, Juanjo Pascual wrote: How can i know which of both is better to use each time? Use mysql_pconnect() if the connection overhead is large. This is usually the case if the database is off on a remote server somewhere in lala land. Remote servers within your LAN don't usually require mysql_pconnect(). Use mysql_connect() for pretty much all other connections. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MYSQL_CONNECT vs MYSQL_PCONNECT
If you're not sure you should probably stick with mysql_connect() - otherwise you could end up bogging down mysql with way more connections than you need if you're not careful. On Jun 20, 2006, at 12:34 PM, Juanjo Pascual wrote: How can i know which of both is better to use each time? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect
Hello, I have a strange bug I can't figure out. I am trying to use a third party library and it is throwing errors: Fatal error: Call to undefined function: mysql_pconnect() This doesn't make sense to me as I have other code on that box that uses mysql_pconnect() with no problem. Why would some code be able to use it while other code can't? Thank! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect() error
Hi guys hope you can all help me here. im in the middle of making a script ( im still quite new), anyway im getting this error Parse error: syntax error, unexpected T_STRING in c:\wamp\www\cms\header.inc on line 5 and on line 5 is mysql_connect($dbhost, $dbusername, $dbpassword) , i know its the mysql_connect() function thats giving me the error though cant seem to get it sorted. below is the versions im using Apache version : Apache/1.3.33 (Win32) PHP version : 5.0.4 MySQL version : 4.1.10a-nt - extension : mysqli all the above come in a bundle package called ( wampserver ) have also posted on wampservers forums for help im using windows xp home. Hope you guys can help me. Thanks Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect() error
Hi guys hope you can all help me here. im in the middle of making a script ( im still quite new), anyway im getting this error Parse error: syntax error, unexpected T_STRING in c:\wamp\www\cms\header.inc on line 5 and on line 5 is mysql_connect($dbhost, $dbusername, $dbpassword) , i know its the mysql_connect() function thats giving me the error though cant seem to get it sorted. below is the versions im using Apache version : Apache/1.3.33 (Win32) PHP version : 5.0.4 MySQL version : 4.1.10a-nt - extension : mysqli all the above come in a bundle package called ( wampserver ) have also posted on wampservers forums for help im using windows xp home. Hope you guys can help me. Thanks Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect() error
Are you sure that is the 5-th line of your script? please give us first 1-10 lines (remove confidential data) for debuging... On 9/3/05, php general help php-general@lists.php.net wrote: Hi guys hope you can all help me here. im in the middle of making a script ( im still quite new), anyway im getting this error Parse error: syntax error, unexpected T_STRING in c:\wamp\www\cms\header.inc on line 5 and on line 5 is mysql_connect($dbhost, $dbusername, $dbpassword) , i know its the mysql_connect() function thats giving me the error though cant seem to get it sorted. below is the versions im using Apache version : Apache/1.3.33 (Win32) PHP version : 5.0.4 MySQL version : 4.1.10a-nt - extension : mysqli all the above come in a bundle package called ( wampserver ) have also posted on wampservers forums for help im using windows xp home. Hope you guys can help me. Thanks Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect vs mysql_pconnect
http://www.google.com/search?lr=ie=UTF-8oe=UTF-8q=mysql_connect%20vs%20mysql_pconnect On Fri, 26 Nov 2004 19:55:29 +0100, fabien champel [EMAIL PROTECTED] wrote: hello, I do not know when I must use mysql_pconnect instead of the mysql_connect :( what are the real advantages of persistent connections, please ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Web standards Planet http://www.w3planet.info/ Personal Blogger http://www.EasyHTTP.com/jad/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect vs mysql_pconnect
ok, i'm sorry, i was probably too tired. i've search the doc, but didn't found this page : http://www.php.net/manual/en/features.persistent-connections.php will me excuse me ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect vs mysql_pconnect
hello, I do not know when I must use mysql_pconnect instead of the mysql_connect :( what are the real advantages of persistent connections, please ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect vs mysql_pconnect
On Fri, 2004-11-26 at 19:55 +0100, fabien champel wrote: hello, I do not know when I must use mysql_pconnect instead of the mysql_connect :( what are the real advantages of persistent connections, please ? http://www.google.com/search?q=advantages+of+persistent+connection -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] mysql_connect
Hi Ben , $connection = mysql_connect$host,$user,$password); if(!$connection) echo echo mysql_error(); After checking error msg . I can help you --Mannoj Kr. Sheoran - Original Message - From: Ben Miller [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Thursday, November 04, 2004 11:52 AM Subject: [PHP] mysql_connect I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? $host=domain.com; $user=username; $password=password; $database=dbname; $connection = mysql_connect($host,$user,$password) or die (Couldn't connect to server.); $db = mysql_select_db($database,$connection) or die (Couldn't select database.); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect
I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? $host=domain.com; $user=username; $password=password; $database=dbname; $connection = mysql_connect($host,$user,$password) or die (Couldn't connect to server.); $db = mysql_select_db($database,$connection) or die (Couldn't select database.); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect
On Thursday 04 November 2004 06:22, Ben Miller wrote: I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? $host=domain.com; $user=username; $password=password; $database=dbname; $connection = mysql_connect($host,$user,$password) or die (Couldn't connect to server.); $db = mysql_select_db($database,$connection) or die (Couldn't select database.); What does mysql_error() say? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The man on tops walks a lonely street; the chain of command is often a noose. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_connect
Guess that would have been helpful. Warning: mysql_connect(): Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/virtual/site2/fst/var/www/html/test/global.php on line 74 Couldn't connect to server. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, November 04, 2004 7:47 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] mysql_connect On Thursday 04 November 2004 06:22, Ben Miller wrote: I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? $host=domain.com; $user=username; $password=password; $database=dbname; $connection = mysql_connect($host,$user,$password) or die (Couldn't connect to server.); $db = mysql_select_db($database,$connection) or die (Couldn't select database.); What does mysql_error() say? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The man on tops walks a lonely street; the chain of command is often a noose. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect
Ben Miller wrote: Guess that would have been helpful. Warning: mysql_connect(): Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/virtual/site2/fst/var/www/html/test/global.php on line 74 Couldn't connect to server. That does not mean that the $host is being replaced by localhost as indicated in your first message. Your grant statement should have been for '[EMAIL PROTECTED]' not just for 'username' as it probably was. If you need more help beyond that you will need to ask in the mysql mailing list. I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect
On Thursday 04 November 2004 06:47, Ben Miller wrote: Please do not top post. Guess that would have been helpful. Warning: mysql_connect(): Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/virtual/site2/fst/var/www/html/test/global.php on line 74 Couldn't connect to server. OK ... I am having trouble connecting to a database on another server. I have Are you able to connect to this remote server from the mysql CLI? If not then this is most likely not a PHP issue and you should refer to the MySQL docs and/or mailing list. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Whatever became of eternal truth? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
On Wednesday 22 September 2004 03:43, Chris Dowell wrote: Sam Hobbs wrote: I am not assuming; that is why I am asking this question. You really can say the same thing except without the emotions. You can simply state the fact that as far as you know it is not a PHP problem. It really, really helps to keep in mind that it is better to simply state facts. That keeps things less emotional and generally keeps things at a more reasonable level. What is ironic is that our protagonist keeps urging everyone to stay rational and not go all emotional when throughout the thread he has repeatedly demonstrated that it was he who was irrational and emotional. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* QOTD: I'll listen to reason when it comes out on CD. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
[snippy] Sam Hobbs wrote: Um.. you do realize you have more problems than php not being able to connect to the database. This is the type of unproductive comment that causes problems. The only reason you are saying this is because you are desperate to make me wrong. You have exhausted reasonable comments and must resort to unreasonable ones. That sure is a problem here. [/snippy] On the contrary, Sam - yours is a comment that is more likely to cause problems - the inevitable backlash of hatred directed at you is founded solely in your mistaken assumption that you alone are correct. If that's truly the case, then why are you asking a bunch of feeble-minded jerks like ourselves for help? We have difficulty enough tying our shoelaces. Since you *have*, misguidedly or otherwise, chosen to come to this list for help, you could have the decency to thank everyone for their suggestions. You asked for our help and we're trying to supply it - if you've tried something already, even if we're just completely and utterly wrong, we've still taken time out of our day, solving our problems to pay our bills in order to help you solve yours. Will you at least have the courtesy to explain how you fixed the problem - that way we can avoid having this conversation again when someone else has the same issue. Cheers Chris p.s. I noticed that you also shouted down Rasmus in a post on the PHP Internals list. You say you're primarily a C++ programmer - would you try and tell Bjorn Stroustroup to shut up? I particularly like this, from that list: [snippy] This is possible and if so then I agree that it is not a php problem and there is not much more for php to do than to give a hint somewhere. [/do you know, some days I feel like a hairdresser] Especially given your reaction when Rasmus suggested exactly that [snippy once more] Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am not sure why you assume this to be a PHP problem. I thought I was being reasonable. I thought I was clear about saying I was not sure it is a PHP problem. I was trying to help by helping diagnose a problem. If it is not a problem then you could say so in a more reasonable manner. If you always react to people this way when they are trying to help then you will have an inferior product since you discourage people from helping. I am not assuming; that is why I am asking this question. You really can say the same thing except without the emotions. You can simply state the fact that as far as you know it is not a PHP problem. It really, really helps to keep in mind that it is better to simply state facts. That keeps things less emotional and generally keeps things at a more reasonable level. [/no more snippy] p.p.s I realise I haven't helped at all, but you're funny and I'm glad of the light relief you inadvertently provide. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_connect does not connect
[snip] I definitely mind. I don't believe in rewarding bad behavior. It is reasonable to contribute to the productive development of solutions, but the attitude in this group is not productive. I have the impression that the real reason you want answers is so that you can continue in unproductive directions. [/snip] Sam, You have nmentioned the word 'insistance' many times in this thread, and the only one I found to be obstinate about things is you. Continue in unproductive directions? What is that about, sport? Rewarding bad behavior? Regardless of the fact that there might be several who could benefit from the solution (who had nothing to do with the folks you are so against right now) you are now the one exercizing unproductive behavior. JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
I definitely mind. I don't believe in rewarding bad behavior. It is reasonable to contribute to the productive development of solutions, but the attitude in this group is not productive. I have the impression that the real reason you want answers is so that you can continue in unproductive directions. Boy, for someone who has over 12k posts on some VC++ forum, you don't seem to have a positive and productive attitude here. Personally, I just think your an arogant ass. BTW, for those of you who can't read between the lines, this means it was a firewall issue. Egads! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Sam Hobbs wrote: Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Would you mind spilling the beans? I'm sure everyone is dying to know what the resolution of this thread is. I definitely mind. I don't believe in rewarding bad behavior. It is reasonable to contribute to the productive development of solutions, but the attitude in this group is not productive. I have the impression that the real reason you want answers is so that you can continue in unproductive directions. This is a totally foolish remark! You make yourself no better than the 'helpers' that 'don't help' you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam Hobbs wrote: I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, Do you have a life ? I hope the moderators protest posts such as this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Sam Hobbs [EMAIL PROTECTED] wrote: Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam Hobbs wrote: I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, Do you have a life ? I hope the moderators protest posts such as this. i protest thats for sure, Raditha, please do not post rhetorical questions to the list :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Would you mind spilling the beans? I'm sure everyone is dying to know what the resolution of this thread is. I definitely mind. I don't believe in rewarding bad behavior. It is reasonable to contribute to the productive development of solutions, but the attitude in this group is not productive. I have the impression that the real reason you want answers is so that you can continue in unproductive directions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Sam Hobbs wrote: Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam Hobbs wrote: I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, Do you have a life ? I hope the moderators protest posts such as this. Moderators? You're in the land of anarchy here. ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
uh huh.. was it your firewall :) :) it was wasnt it.. im so bad, im so bad it hurts, but i solved your problem, so come on, a cookie or something..pat on the head, or how about, thanks for helping. Jason Sam Hobbs [EMAIL PROTECTED] wrote: Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Would you mind spilling the beans? I'm sure everyone is dying to know what the resolution of this thread is. I definitely mind. I don't believe in rewarding bad behavior. It is reasonable to contribute to the productive development of solutions, but the attitude in this group is not productive. I have the impression that the real reason you want answers is so that you can continue in unproductive directions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote Sam Hobbs: And the relevant portion of that says external access, which is not applicable here. I do not see anything else on that page that is relevant. what is relevant? only the last one? :sigh: I don't know. Ask them, not me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Um.. you do realize you have more problems than php not being able to connect to the database. This is the type of unproductive comment that causes problems. The only reason you are saying this is because you are desperate to make me wrong. You have exhausted reasonable comments and must resort to unreasonable ones. That sure is a problem here. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Being obstinate and contrarian does nothing to help resolve your problem. This is more unnecessary and unproductive comments. Since you did not have something relevant and productive to say the best thing to do is say nothing. I hope the moderators agree. Would I be correct if I paraphrased the above as: The wrong way to get Sam Hobbs to try something that might help in solving his problem: [JD] The firewall might be blocking your attempts to connect to mysql. Try disabling it. [SH] Yeah and what makes you think that? I KNOW the firewal has nothing to do with it. Get real (and go away). The right way to get Sam Hobbs to try something that might help in solving his problem: [JD] The firewall has nothing to do with your problem. But try disabling it anyway. [SH] Yeah that sounds reasonable. Thanks, I'll try that. How silly is that? You paraphrased version is not accurate. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Steve Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam, if you wouldn't mind answering a question: are you still unable to connect to your mysql server? I am able to connect now. I'm sorry that you feel its a time-consuming process. I'm sorry that you are confused about the involvement of the firewall. I'm sorry that you feel you know better than everyone on this list. Just try this and prove us wrong. The problem is that people's insistance. It was people's reaction when I said I thought it was not relevant. There was a lot of stuff said that was unnecessary. People could have simply said to try it, without the criticism. To the extent that I was wrong, the apporopriate thing to do is to state whatever facts are relevant and then give me a chance to use that information. I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, and about 99% of the messages were efforts to help people. I know that there are people that will not listen. When a person will not listen, it is a big mistake to insult them. The attitude in this group would cause a serious flame war if someone were truly not listening. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Sam Hobbs wrote: I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, Do you have a life ? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Matthew Sims [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You should check as XP SP2 firewall is turned on by default. http://support.microsoft.com/default.aspx?kbid=842242 Saying You should check assumes I did not check. I did check. I said as far as I know it is off. I am sorry that that does not state explicitly that I checked, but if I had not checked it then I would have stated explicitly that I did not. What I meant is that I don't see anything saying that the firewall is on. When I go to whereever it is that the firewall is configured, it is off. The only reason I am confused is because there are events in the security log complaining about use of some ports and I don't understand that. The messages seem to be produced in spite of the Windows firewall being off. I did explicitly turn off the Windows firewall soon after installing ZoneAlarm over two years ago and again after SP2 was installed. Note that XP has always had a firewall, it just has been improved and made reasonably useful in SP2. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
On Saturday 18 September 2004 21:04, Sam Hobbs wrote: Steve Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam, if you wouldn't mind answering a question: are you still unable to connect to your mysql server? I am able to connect now. Would you mind spilling the beans? I'm sure everyone is dying to know what the resolution of this thread is. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Of course there's no reason for it, it's just our policy. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
That is the type of comment that causes problems. Reasonable and knowledgable people know it is not true and saying it just causes problems. Of course, many people would advise to just ignore comments such as that and I will in the future. I just want to make it clear for the benefit of others that this is the type of comments that has caused problems. Jason Davidson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Windows XP Firewall, or any other firewall for that matter must be off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
Sam Hobbs wrote: Steve Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sam, if you wouldn't mind answering a question: are you still unable to connect to your mysql server? I am able to connect now. I'm sorry that you feel its a time-consuming process. I'm sorry that you are confused about the involvement of the firewall. I'm sorry that you feel you know better than everyone on this list. Just try this and prove us wrong. The problem is that people's insistance. It was people's reaction when I said I thought it was not relevant. There was a lot of stuff said that was unnecessary. People could have simply said to try it, without the criticism. To the extent that I was wrong, the apporopriate thing to do is to state whatever facts are relevant and then give me a chance to use that information. I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, and about 99% of the messages were efforts to help people. I know that there are people that will not listen. When a person will not listen, it is a big mistake to insult them. The attitude in this group would cause a serious flame war if someone were truly not listening. I'm SO not listening to you... ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] mysql_connect does not connect
Hi All, I don't normally bother with these kind of meaningless threads as they waste valuable electrons but I did find this interesting http://www.urban75.com/Mag/troll.html PS This is not a dig at you Jason, it's just your post is the only one I didn't delete :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] mysql_connect does not connect
I may be unnaturally ugly (to the extent my mother cried when she held me), and so i have a little extra hair here and there.. and my hands are like hams.. but im no troll :P :P Jason Tom Rogers [EMAIL PROTECTED] wrote: Hi All, I don't normally bother with these kind of meaningless threads as they waste valuable electrons but I did find this interesting http://www.urban75.com/Mag/troll.html PS This is not a dig at you Jason, it's just your post is the only one I didn't delete :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect does not connect
oh booh, i replied to that, explicitly detailing you can simply allow an open port for mysql rather than drop the whole firewall. Yes this type of comment cuases problems, or in your case, fixes your problem... at least your mysql connection one. so are you saying im unreasonable, and unknowledgable, me, the person who although blasted with a few emails, telling me i dont understand how localhost works, had the correct solution to your problem .. thanks sam, glad to be of service. BTW, good posts on PHP Internals, have you noticed that the whole world is irrelevent and unreasonable, well, except for you Jason Sam Hobbs [EMAIL PROTECTED] wrote: That is the type of comment that causes problems. Reasonable and knowledgable people know it is not true and saying it just causes problems. Of course, many people would advise to just ignore comments such as that and I will in the future. I just want to make it clear for the benefit of others that this is the type of comments that has caused problems. Jason Davidson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Windows XP Firewall, or any other firewall for that matter must be off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_connect does not connect
This has got to be one of the funniest threads I've seen on the PHP list in a really long time. However, unless someone can come up with more humorous replies, I vote that it be killed. -Ed -Original Message- From: Jason Davidson [mailto:[EMAIL PROTECTED] Sent: Saturday, September 18, 2004 10:35 AM To: Sam Hobbs; [EMAIL PROTECTED] Subject: Re: [PHP] mysql_connect does not connect oh booh, i replied to that, explicitly detailing you can simply allow an open port for mysql rather than drop the whole firewall. Yes this type of comment cuases problems, or in your case, fixes your problem... at least your mysql connection one. so are you saying im unreasonable, and unknowledgable, me, the person who although blasted with a few emails, telling me i dont understand how localhost works, had the correct solution to your problem .. thanks sam, glad to be of service. BTW, good posts on PHP Internals, have you noticed that the whole world is irrelevent and unreasonable, well, except for you Jason Sam Hobbs [EMAIL PROTECTED] wrote: That is the type of comment that causes problems. Reasonable and knowledgable people know it is not true and saying it just causes problems. Of course, many people would advise to just ignore comments such as that and I will in the future. I just want to make it clear for the benefit of others that this is the type of comments that has caused problems. Jason Davidson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Windows XP Firewall, or any other firewall for that matter must be off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php