RE: [PHP-DB] Help! Can't "select" db after uploading file from mu lti-part form
| From: | Zak Greant | Date: | Mon, 19 Jun 2000 20:53:50 +0000 |
| Subject: | RE: [PHP-DB] Help! Can't "select" db after uploading file from mu lti-part form | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-498@lists.php.net to get a copy of this message | ||
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