Re: HELP: Syntax Needed
| From: | DL Neil | Date: | Sun, 28 Oct 2001 22:14:47 +0000 |
| Subject: | Re: HELP: Syntax Needed | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72648@lists.php.net to get a copy of this message | ||
> 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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>