Re: [PHP] HELP: Syntax Needed

2001-10-29 Thread Christian Reiniger

On Sunday 28 October 2001 20:53, jtjohnston wrote:
 Jokes aside, I still don't get it.

*g*

 This works:
 mysql_pconnect($host,AccountName,beep);

 Why doesn;'t this?

  $myconnection = mysql_pconnect($host,$MyTable,$MyPassword);

Compare what arguments you pass. Especially the second one. In the first 
example you supply your account name. That's fine. mysql_pconnect expects 
it in that place.
The second time you use the table name instead of the acctname, so it 
tries to log in with username $MyTable, passwd $MyPassword

And unless you have a very weird setup this will always fail :)

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

This is JohnC IMHO, I compaired tri-word groupings here and in his plan
and got a good match.

- /. posting discussing the likelihood that an AC post that claimed to be
posted by John Carmack during his honeymoon (and having the login info at
home) was actually from him.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HELP: Syntax Needed

2001-10-28 Thread DL Neil

 Jokes aside, I still don't get it.

=the word it is part of the difficulty everyone faces in thinking about whether they 
could help or not - what
it is, is not apparent
1 there is a problem with a mysql_pconnect() call, and
2 there is a problem with a mysql_query() call.
Which one is it?

=the confusing presentation of the question, even more confused by the lack of 
substance/focus in the rejoinder,
is not helping.

=the very first suggestion that those who have answered more-or-less this exact 
'pconnect' question many times a
week for ..., is a not-so-subtle hint to RTFM (and/or to review the list archives). 
When you read up about how
to write variables and constants, and how to use the mysql_... functions, then more 
will become obvious, and
less sarcasm will come your way.

=worse, you have quoted incomplete/inaccurate code fragments, so immediately the 
question arises: what else has
been left out? (the answer being closely related to it).

=The manual clearly says that missing out certain calls may not matter because MySQL 
will make assumptions and
attempt to carry on, but the instant problems arise, surely it would be better to 
follow all the examples in the
manual - which step through all of the calls, in sequence?

=next point: if you have a problem with a series of instructions, go back to first 
principles, break things down
and throw in echo/printr statements to 'prove' any and all assumptions - particularly 
the first time you try out
some code.

=last point: EVERY call to a client-server function should be checked (there's RTFM 
again), this will show if
the fault lies at 'pconnect', at 'open', and/or at the 'query' stage.

=dn
PS lecture mode off - please take advantage of our 'two-fer' special offer: any two 
well formed questions sent
to the list this week will be answered for the same price as one!



  $host = localhost;
  $MyAccount = AccountName;
  $MyTable = Table1;
  $MyPassword = beep;

 This works:
 mysql_pconnect($host,AccountName,beep);
 $news = mysql_query(SHOW TABLE STATUS FROM AccountName LIKE 'Table1');

 Why doesn;'t this?

  $myconnection = mysql_pconnect($host,$MyTable,$MyPassword);
  ...
  $news = mysql_query(SHOW TABLE STATUS FROM $MyAccount LIKE
  '$MyTable');

 I have tried variations with or without  and '. Is there a way to make this
 work? Or do I have to do as above every time?

  $host :)

 Your telling me to put $host in $host? OK:

  $myconnection = mysql_pconnect($host,$MyAccount,$MyPassword);

 It doesn't work?! Neither does:

  $myconnection = mysql_pconnect($host,$MyAccount,$MyPassword);
  $myconnection = mysql_pconnect('$host','$MyAccount','$MyPassword');

 If I try this, $stringing just $host, it works!?

 mysql_pconnect($host,AccountName,beep);



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]