The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
create a custom database entry - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: create a custom database entry (/showthread.php?tid=170)



create a custom database entry - michaelspeed - 06-18-2016

can you guide me through custom database entry which is needed during registration??


create a custom database entry - mudmin - 06-18-2016

I just want to be clear...are you wondering how to add custom fields to the registration form? Things like addresses and stuff like that and store them in the database?


create a custom database entry - caleb - 06-19-2016

i am wondering the same thing. adding a field and storing it in the dbase


create a custom database entry - mudmin - 06-19-2016

The join.php form is a little bit more complicated than the other forms in userspice. Basically, you want to add a new field to the join form, let's say "address."

Then you want to make a new column in the users table called "address."

Then the quickest thing to do is to go into classes/User.php and in the create method add a line like

Code:
$query3 = $this->_db->insert("users",['address'=>$address);

That's the quick and dirty way to do it.


create a custom database entry - mudmin - 06-19-2016

I should add that the proper way to modify the join form is to copy it to the usersc folder and point the init.php to the proper location.

Also, in the (Very rare) event that we update the user class, your change will be overwritten, but I don't see that happening. You'll also be notified if an update changes a class.


create a custom database entry - Brandin - 06-07-2017

@mudmin,

Looks like we got some spammers!

Thank you,


create a custom database entry - mudmin - 06-08-2017

Yeah. There's something about this post that keeps attracting them. I've stepped up the spam protection. We'll see.