--- Peter Lovatt <[EMAIL PROTECTED]> wrote:
> hi
> 
> the
> 
> /home/lark/public_html/connection.php on line 23
> 
> just refers to the file within the context of the
> whole file system and is
> fine
> 
> the rest says that mysql cannot/does not execute the
> query so there is no
> result to use.
> 
> the @ suppresses error messages so it may be best to
> remove  it
> 
> try
> 
>   mysql_connect ("localhost" , "USERNAME" ,
> "PASSWORD");
>   or die(mysql_error());
> 
>   mysql_select_db ("DATABASE");
>   or die(mysql_error());
> 
> which may tell you more - I suspect a permissions
> problem if it works on a
> local server
> 
> If you are switching from a Windows machine to Linux
> remember to watch for
> case sensitivity problems.

OK, thanks. Also, I didn't realize that some hosts
won't let you connect to remote databases. I tried
another local connection, using your notes, and it
worked this time.

I thought I could make a life a little easier by
publishing my database to a couple sites, then linking
all my sites to them remotely, but it looks like I'm
going to have to put two dozen copies of it online!

Thanks.


> 
> > -----Original Message-----
> > From: David Blomstrom
> [mailto:[EMAIL PROTECTED]
> > Sent: 27 June 2004 20:49
> > To: [EMAIL PROTECTED]
> > Subject: Database Connection Questions
> >
> >
> > I'm previewing local pages with a database
> connection
> > that looks something like this:
> >
> > @mysql_connect ("localhost" , "USERNAME" ,
> > "PASSWORD");
> > @mysql_select_db ("DATABASE");
> >
> > I modified it for an online site and published it
> > online. But when I preview a page, I get error
> > messages like the following:
> >
> > Warning: mysql_fetch_array(): supplied argument is
> not
> > a valid MySQL result resource in
> > /home/lark/public_html/connection.php on line 23
> >
> > Warning: mysql_fetch_assoc(): supplied argument is
> not
> > a valid MySQL result resource in
> > /home/lark/public_html/connection.php on line 41
> >
> > Warning: mysql_fetch_assoc(): supplied argument is
> not
> > a valid MySQL result resource in
> > /home/lark/public_html/connection.php on line 45
> >
> > Do those URL's look odd - like they're OUTSIDE of
> my
> > website (/public_html/)?
> >
> > And I get this error at the bottom of the page:
> >
> > "Invalid query: No database selected"
> >
> > So I published my database to a different website
> and
> > tried to make a remote connection. I was told that
> all
> > I have to do is replace "localhost" with a URL, so
> my
> > new query looks like this:
> >
> > @mysql_connect ("www.othersite.org" , "USERNAME" ,
> > "PASSWORD");
> > @mysql_select_db ("DATABASE");
> >
> > But I get the same results. I'm not even sure
> where to
> > begin troubleshooting, because I'm not certain
> what
> > the root of the problem is.
> >
> > Any suggestions?
> >
> > Thanks.
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:   
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:   
>
http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 



                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to