Loading...
 
Development

Development


How can i insert form data into a database?

posts: 5

Hello,

i am trying to get a form send into a new table in the tikiwiki database.
it is an absence form where u can mark students absence and then it is submitted by Post.

As i can see i got the variable and arrays set and made (checked with debug option). Now i only need some help how to make the function in the lib correct to insert it in the new database table.

is there someone who can help me to get on my way?

i probably have to start with this

$query = "insert into `tiki_absent`(`login`,`abdate`,`course`,`ababla`,`reason`,`comment`) values(?,?,?,?,?,?)";

the abdate and course are the only values wich are not an array the rest is.

now the prob is how to insert the parts of the array with the course and abdate vars?

I hope this is clear enough.

For thr one who can and will help me out. Many Thanks.


posts: 5

It seems that i am getting a step further.. now the problem is that it doesnt see the table in the database.

The name is correct, but somehow it wont recognize it from the function. Are the Tables from the database listed somewhere for tikiwiki to recognize??

Please help!!


posts: 1811 Catalan Countries

no idea. Ask on irc.

Btw, join us at http://edu.tikiwiki.org
We'd love to hear how you use tiki in educative contexts (and you might be interested in reading other uses)
Cheers, xavi



posts: 80 Austria

Hi!
I have problems inserting data from a text field into the DB. Everything works fine until i enter a ? nayhwere in the field an try to save it.
Example:
I enter in my textfield: "test2 ?"
My query looks like: $wquery="UPDATE `Testbed_EQN` SET `Name` = '$TeNameN' WHERE `EQN` = ?";
then i get an error like this:
UPDATE `Testbed_EQN` SET `Name` = 'test2 'E001' >' WHERE `EQN` =

Could this be solved with preg_replace?
Or how would you do it?
Thank you!


posts: 1550 Canada

I suggest you use Tiki trackers

M ;-)