in reply to Re: Re: Learning DBI
in thread Learning DBI
You're setting up a SELECT SQL statement selecting date, title and entry fields from a table called News. This is what prepare does. In the next statement this gets executed, i.e. the query is actually submitted to the database. The while loops over the rows fetched from the database and prints them out.
Of course, your database should have a table News with fields date, title and entry to start with.
First you should check what tables have been defined, if any. This can be done using the mysql client that comes with mysql, or even by just peeking into the file system (if memory serves). There's also an SQL query to do this, but I don't remember it of hand.
Hope this helps, -gjb-
Update: You really don't want qw since this evaluates to a list of words while prepare is expecting just a single string. Use q or qq instead.
|
|---|