just starting - need database basics

6 views
Skip to first unread message

Steve

unread,
Oct 17, 2010, 9:14:20 PM10/17/10
to haXigniter
I have set up haXigniter successfully on my Windows Vista system using
Apache 2.2 and mod_php. The built-in pages seem to work fine, but I'm
trying to get very basic database access going and I've hit a wall.

I have altered my Database.hx file to have the appropriate values (I
can connect using the parameters from the mysql command line). But
any access of db.query or db.open or anything like that results in
some sort of timeout which seems to even prevent any logging of the
error that caused it (log statement preceding db.query is present in
the log, log statements immediately following it and in the
catch(unknown:Dynamic) block of the "try" surrounding db.query do not
appear. Eventually, after several seconds the page appears to time-
out and render a completely empty document (no source either).

I'm at a loss. What are the very basics for setting up db access with
haXigniter? Or at least being able to catch and log db errors so I
know what's going wrong?

postite

unread,
Oct 18, 2010, 6:04:35 AM10/18/10
to haxig...@googlegroups.com
hello steve ,

from my own experience ... you don't have to open or close the database connection ... to get started
if you extend your controller from MyController (default) you can access the db simply.

example:

var rawUsers= db.query("SELECT * from user");

or
db.insert("user",vo);

wish it could help. :)

Steve

unread,
Oct 18, 2010, 8:34:17 AM10/18/10
to haXigniter
Thanks for replying. I eventually figured out the issue late last
night. The problem was that mysql apparently does not like
"localhost", but is just fine with "127.0.0.1".
Reply all
Reply to author
Forward
0 new messages