Re: [PHP4BETA] Latest CVS - Question
| From: | Sarah Pearson | Date: | Tue, 21 Sep 1999 09:54:40 +0000 |
| Subject: | Re: [PHP4BETA] Latest CVS - Question | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4739@lists.php.net to get a copy of this message | ||
Dustin Marquess [jailbird@alcatraz.fdf.net] wrote:
> >
> > However, if I put $db as the link identifer in mysql_select_db I get the
> > document contains no data error. I do not know if this is an error or
> > intentional.
>
> Probably because you are assigning $db the result of the
> mysql_connect, which is a MySQL data structure. mysql_select_db() wants
> the name of the database you want to select, not the structure. Try:
>
> $blah = "pcstuff";
> @mysql_select_db($blah) or die("Could not select database.");
I hear what you are saying and it works, just like my code snippet does. However,
if you include the link identifer in the mysql_select_db statement it gives the
document comtains no data error message. Not very useful when I have 2 or more databases
open at once.
The following code taken directly from the Core Programming Book (with my echo statement) has
the same problem : (I created a temp database called store).
<?
$mysql_link = mysql_connect("localhost", "root", "");
mysql_select_db("store",$mysql_link);
echo "Boo!";
?>
Even putting :
$blah = "store";
mysql_select_db($blah, $mysql_link);
gives the error.
Having the link identifer in the select_db statement worked fine until a CVS download
yesterday. If the format of the command has changed then fine, but to me it looks
like a possible problem.
--
Sarah Pearson
sarah@zippysoft.com