RE: [PHP-DB] Help! Can't "select" db after uploading file from mu lti-part form
| From: | CJ Romberger | Date: | Mon, 19 Jun 2000 20:58:17 +0000 |
| Subject: | RE: [PHP-DB] Help! Can't "select" db after uploading file from mu lti-part form | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-499@lists.php.net to get a copy of this message | ||
I would agree, except that I did a lot to try to eliminate that possibility.
For example: 1) if I take all the file copy stuff out of this file, it
works perfectly. 2) I also tried putting a || die ("Can't connect")
statement after the original connect - doesn't die. 3) If I embed the
select inside an if(mysql_connect) statement, it executes (but errors)
....I've tried this more ways than you can imagine. oh, yes, and 4)
(although I tried this VERY late one night, so I think I will try it again
to make sure I'm not lying) if I take the multi-part form out of the picture
and just send the file in by typing in the name, it all worked, too.
CJ
"No other personal quality contributes to success more than relentless
persistence in the pursuit of one's goals."
-----Original Message-----
From: Zak Greant [mailto:zak@nucleus.com]
Sent: Monday, June 19, 2000 3:54 PM
To: CJ Romberger
Cc: 'php-db@lists.php.net'
Subject: RE: [PHP-DB] Help! Can't "select" db after uploading file from
mu lti-part form
At 03:41 PM 6/19/00 -0500, CJ Romberger wrote:
>Awesome! I didn't get any errors (all zeros), but your reply made me go
>find an example of how to use the mysql_error, and I rewrote the code (see
>below-non-working code commented out.) Not sure why it works this way and
>not the other, but it DOES! If I knew where you were, I'd send you
cookies!
>:)
>
>Thanx everyone for helping me!
>
>CJ
> mysql_connect("localhost", "username", "password");
> echo mysql_errno().": ".mysql_error()."<BR>";
> mysql_select_db("databasename");
> echo mysql_errno().": ".mysql_error()."<BR>";
> $conn = mysql_query("SELECT * FROM address_book");
> echo mysql_errno().": ".mysql_error()."<BR>";
Hi CJ,
Glad to err... help? :) The reason why this chunk of code works is that
when mysql_select_db has only one argument, it will use the last available
connection to a mysql database if one exists.
That this code works while your previous code did not suggests an error in
the parameters that were passed to mysql_select_db.
Ciao,
Zak Greant
Creative Director
Nucleus Information Service Inc.
"I am rather like a mosquito in a nudist camp: I know what I ought to do,
but I don't know where to begin."
- Stephen Bayne
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net