Re: Moto interface to MySQL
Cory Wright <[email protected]> Wed, 5 Mar 2003 23:41:51 -0500
| Newsgroups | gmane.comp.lang.moto.user |
|---|---|
| Organization | Stand Blue Technology |
| Message-ID | <[email protected]> |
[ Only following up to the users lists ]
On Wed, Mar 05, 2003 at 08:14:26PM -0700, Jack wrote:
> $if(getValue("begin_month") == null) OOps, no begin_month $endif
> $if(getValue("end_month") == null) OOps, no end_month $endif
> $if(getValue("begin_day") == null) OOps, no begin_day $endif
> $if(getValue("end_day") == null) OOps, no end_day $endif
> $if(getValue("begin_year") == null) OOps, begin_year $endif
Consider using the safer, two parameter version of getValue():
${
void checkIt(String varname) {
if(getValue(varname,"") eq "") {
print "Oops, " + varname + " is not set!<br />\n";
}
}
checkIt("begin_month");
checkIt("end_month");
checkIt("begin_day");
checkIt("end_day");
checkIt("begin_year");
}$
> MySQLConnection conn = new
> MySQLConnection("localhost","c4_webapp","user","pass");
[...]
> Okay, fine it works great on my local machine - runs as expected.
> When I upload this to the server, it would seem that moto takes
> localhost to mean ME... the client on my side of the browser.
> Contrast this with PHP, where localhost is the server.
Hum, this sounds more like a networking issue to me. Do you have "localhost"
mapped to anything other than 127.0.0.1? Look in your /etc/hosts file, and
then check the DNS configuration.
> In anycase, it tries access the data on my home server and everything
> again works, but if I access from a windows machine an error occurs.
Definately strange. This problem is almost definately outside of Moto.
Moto simple passes the connection parameter through to the MySQL driver.
The MySQL libraries do the actual connecting using the host that you gave
it when you created the MySQLConnection object.
> If I replace the name localhost with either the server IP or the
> domainname, I end up getting this error:
>
> /var/www/site/query.moto:27: Uncaught SQLException
> message: Host 'deer.cyberport.net' is not allowed to connect to this MySQL server
This looks like more evidence that the problem is in DNS. If you want to
mail me off list I will gladly help you get this worked out.
Cory
--
Cory Wright
Stand Blue Technology
http://www.standblue.net/