Re: [PHP] mysql_connect noob question

2013-04-24 Thread Richard Quadling
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_hostis undefined (de

Re: [PHP] mysql_connect noob question

2013-04-23 Thread Jim Giner
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

Re: [PHP] mysql_connect noob question

2013-04-23 Thread Glob Design Info
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

Re: [PHP] mysql_connect noob question

2013-04-23 Thread Tedd Sperling
On Apr 21, 2013, at 3:33 PM, Glob Design Info 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 G

Re: [PHP] mysql_connect noob question

2013-04-22 Thread Jim Giner
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

Re: [PHP] mysql_connect noob question

2013-04-21 Thread tamouse mailing lists
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." To

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 22 Apr 2013, at 00:36, Glob Design Info 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 co

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 22 Apr 2013, at 00:35, 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. Building your house by making your own bricks is daft. Using bricks somebody else h

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 wrote: Except that I want to use my script and form - precisely because I have already sunk time

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 wrote: Except that I want to use my script and form - p

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 22 Apr 2013, at 00:16, Glob Design Info 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 alread

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 P

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 ca

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 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 men

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 h

Re: [PHP] mysql_connect noob question

2013-04-21 Thread David OBrien
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 wrote: > > I should note my user name in this case *is* an email address, however > the dots

Re: [PHP] mysql_connect noob question

2013-04-21 Thread David OBrien
> 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 sqlyo

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 21 Apr 2013, at 23:01, Glob Design Info 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

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 21 Apr 2013, at 22:43, Glob Design Info 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

Re: [PHP] mysql_connect noob question

2013-04-21 Thread David OBrien
On Sun, Apr 21, 2013 at 6:01 PM, Glob Design Info wrote: > 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) > i

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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, loo

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 wrote: > Not meaning to beat the proverbial dead horse > > I am developing a web portal that has to displ

Re: [PHP] mysql_connect noob question

2013-04-21 Thread David OBrien
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

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Glob Design Info
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 wrote: > On Apr 21, 2013, at 9:32 AM, Stu

Re: [PHP] mysql_connect noob question

2013-04-21 Thread tamouse mailing lists
On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info 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 s

Re: [PHP] mysql_connect noob question

2013-04-21 Thread tamouse mailing lists
On Sun, Apr 21, 2013 at 9:49 AM, Stuart Dallas wrote: > On 21 Apr 2013, at 15:46, tamouse mailing lists > wrote: > >> On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling >> wrote: >>> On Apr 21, 2013, at 9:32 AM, Stuart Dallas wrote: However, a more important question for me is why you are do

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Stuart Dallas
On 21 Apr 2013, at 15:46, tamouse mailing lists wrote: > On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling > wrote: >> On Apr 21, 2013, at 9:32 AM, Stuart Dallas wrote: >>> However, a more important question for me is why you are doing this. You >>> say you are aware of the security implications

Re: [PHP] mysql_connect noob question

2013-04-21 Thread tamouse mailing lists
On Sun, Apr 21, 2013 at 9:12 AM, Tedd Sperling wrote: > On Apr 21, 2013, at 9:32 AM, Stuart Dallas 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

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Tedd Sperling
On Apr 21, 2013, at 9:32 AM, Stuart Dallas 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 > develo

Re: [PHP] mysql_connect noob question

2013-04-21 Thread tamouse mailing lists
On Sat, Apr 20, 2013 at 9:37 PM, Glob Design Info 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 wrote: >> >>> On 20 Apr 2013, at 16:25, Jim Giner wrote: >>>

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Glob Design Info
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 wrote: On 20 Apr 2013, at 16:25, Jim Giner wrote: Why are you allowing anyone to connect to your database from a form? A little

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Tedd Sperling
On Apr 20, 2013, at 11:44 AM, Stuart Dallas wrote: > On 20 Apr 2013, at 16:25, Jim Giner 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 conn

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Glob Design Info
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

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Jim Giner
On 4/20/2013 11:44 AM, Stuart Dallas wrote: On 20 Apr 2013, at 16:25, Jim Giner 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 t

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Stuart Dallas
On 20 Apr 2013, at 16:25, Jim Giner 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

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Jim Giner
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

Re: [PHP] mysql_connect noob question

2013-04-20 Thread David OBrien
> > > $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

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Tedd Sperling
On Apr 19, 2013, at 4:43 PM, Glob Design Info 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 s

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Glob Design Info
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, t

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Glob Design Info
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

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Matijn Woudt
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 l

Re: [PHP] mysql_connect noob question

2013-04-20 Thread tamouse mailing lists
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: and

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
Dunno. The code definitely has the underscore. On Apr 19, 2013, at 9:11 PM, Jim Giner 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 wrote: >> >>> On 4/19/2013 9:3

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Jim Giner
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 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.

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
No, no spaces. I am wondering if I need to use htmlspecialchars() On Apr 19, 2013, at 7:17 PM, Jim Giner 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.

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Jim Giner
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 p

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
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 c

Re: [PHP] mysql_connect noob question

2013-04-19 Thread David Robley
Glob Design Info wrote: > Sorry. The error displayed is: > > *Warning*: mysql_connect() [function.mysql-connect > ]: Access denied for > user ''@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in > */Library/WebServer/Documents/wservices/c

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
Sorry. The error displayed is: *Warning*: mysql_connect() [function.mysql-connect ]: Access denied for user ''@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in */Library/WebServer/Documents/wservices/connect.php* on line *29* (But w

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
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 whe

Re: [PHP] mysql_connect noob question

2013-04-19 Thread tamouse mailing lists
On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info 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 s

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Matijn Woudt
On Fri, Apr 19, 2013 at 10:59 PM, Glob Design Info wrote: > 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?

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Glob Design Info
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 1

Re: [PHP] mysql_connect noob question

2013-04-19 Thread Matijn Woudt
On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info 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