Page 1 of 1

Mysql Module

Posted: Mon Oct 13, 2008 2:19 pm
by Aaron_H
Hi all,

I am currently develeping a module like the File Upload, accept i have developed all the scripts, i want one of the tabs in the admin section to allow admins to upload files to a directory but at the same time insert data they fill in, into a mysql table, the mysql INSERT side of thing does not seem to be working tho?

Basicly:

Form Variables -> Php Handler -> Database

Thanks

Re: Mysql Module

Posted: Mon Oct 13, 2008 4:47 pm
by alby
Aaron_H wrote: Form Variables -> Php Handler -> Database
I don't see any problem, many modules do it: Cataloger, Album, ....
Look in these code

Alby

Re: Mysql Module

Posted: Mon Oct 13, 2008 5:29 pm
by Aaron_H
Hi,

I have tried the script from the news system, cutting out the mysql insert, no look though,

any more help greatly appreciated, thanks.

Re: Mysql Module

Posted: Mon Oct 13, 2008 5:42 pm
by alby
Aaron_H wrote: I have tried the script from the news system, cutting out the mysql insert, no look though,
In general you put many die statement and go for debug or if you have sql problem only check in sql tool (ex: phpmyadmin your query)

Alby

Re: Mysql Module

Posted: Tue Oct 14, 2008 12:49 pm
by Aaron_H
Thanks for the advice,

I am not the best programmer, i havent been doing it at a advacned level realy,

Is it:

$query = 'INSERT INTO '.cms_db_prefix().'module_homework (class, type) VALUES ('.$img.','.$img.')';
$db->Execute($query);

its probaly rong so help would be nice.

Thanks

Re: Mysql Module

Posted: Tue Oct 14, 2008 2:03 pm
by alby
Aaron_H wrote: $query = 'INSERT INTO '.cms_db_prefix().'module_homework (class, type) VALUES ('.$img.','.$img.')';
No,
$query = "INSERT INTO ".cms_db_prefix()."module_homework (class, type) VALUES ('$img','$img')";

Alby

Re: Mysql Module

Posted: Wed Oct 15, 2008 10:10 am
by Aaron_H
Alby thanks alot for your help,

i have had it working now, however some new help is needed, one one of the tabs i want a file manager, so they can view the homework files they uploaded and manage them, now is it possible to copy part of the file manager script into new files in my homework module, if not how would i got about doing the file manager.

THankss