1
mikee
Custom module - Problems querying database from module admin pages
  • 2005/7/25 15:13

  • mikee

  • Just popping in

  • Posts: 1

  • Since: 2005/7/25


Greetings!

I'm trying to add an admin page for inserting records into my database, but have run into a brick wall.

Here's a compact version of my function:
funcion addEvent() {
   
$xoopsDB =& Database::getInstance();
   
xoops_cp_header();
   
$query=(VALID MySQL QUERYI tested it by echoing it and copy/pasting it into the MySQL cli.)
   if(
$xoopsDB->query($query))
      
redirect_header("index.php",1,"Event was added.");
    else {
      
$query_error $xoopsDB->error();
      
redirect_header("index.php",7,"Event was NOT added.  SQL Query was:
$query

Error was:
$q
uery_error"
);
   }
}


This always results in the query failing, but there being no error message. I got the basic structure from some other modules, and I can't figure out how mine is different. Any help would be greatly appreciated :)

Login

Who's Online

150 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 150


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jan 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits