Reply to Re: No database selected

Your name:

Reply:


Posted by Dave on 05/23/05 06:11

Shelly (sheldonlg@asap-consult.com) decided we needed to hear...
> "Dave" <dave@REMOVEbundook.com> wrote in message
> news:7hq7m2-p5t.ln1@fawlty.homelinux.net...
> > While your test machine may have only one (default) database, your
> > remote machine will probably require you to specify which db you
> > want to use... you can do this right after you connect with a call
> > such as
> > $status = mysql_select_db($database_ssLogin, $ssLogin);
> >
> > As an aside, are you sure your webhost allows persistent connections?
> > I wouldn't have thought so, but a few might I suppose.
>
> I had one already there:
> mysql_select_db($database_ssLogin, $ssLogin);
> $encryptedPassword = md5($_POST["password"]);
> $LoginRS__query=sprintf("SELECT username, password, level, status
> FROM ssusername WHERE username='%s' AND password='%s'",
> get_magic_quotes_gpc() ? $loginUsername :
> addslashes($loginUsername),
> $encryptedPassword);
> $LoginRS = mysql_query($LoginRS__query, $ssLogin) or die(mysql_error());
>
> where it fails.
>
> Here is a possiblity. Tell me what you think. On my local machine I am
> running PHP5 but I think the server is running PHP4.x
>
> Shelly
>
I wouldn't have thought PHP version should matter in this case - more
likely its a MySQL issue.

I would try checking the return value from mysql_select_db. If you get
false then that might indicate a permissions problem. e.g. with my host
when I create a MySQL user I then have to associate that user with any
database I want to use it with, as a seperate step - if thats not done
then even though I can connect fine, selecting a database will fail
until I associate the user...

--
Dave <dave@REMOVEbundook.com>
(Remove REMOVE for email address)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация