Skip to main content
Topic: Beginner need some help (Read 1250 times) previous topic - next topic

Beginner need some help

New to this environment, I have a lot of experience with dbase on windows systems. Anyway I have a pretty simple question I made an application to start with the  data files and when I go to add a record I have to type in the value of the main user field in order for it to stay in the list of records for that user. Is there anyway to add a record where it will consistently fills in the user field with the value of the user. ?

I experimented around with a few things such as below but then I get a error 2300 which I guess means you can't update  primary field?
 
put this in after page.....
  $db->rawQuery("UPDATE customers SET user=$USER_ID  WHERE id='$rec_id' ");

 *********this worked..
$xxx = USER_ID;
$db->rawQuery("UPDATE customers SET user=$xxx  WHERE id='$rec_id' ");


thank you!

Re: Beginner need some help

Reply #1
@nightcasters‍ please use the DefaultValue configuration in Add Page Field Properties to automatically fill user value to the field. Here is the phprad doc to help you understand more about phprad.

Re: Beginner need some help

Reply #2
Thank you

 

Re: Beginner need some help

Reply #3
 Still having some difficulty with this issue, I started a new project with 2 tables, customer and invoice.. pretty simple.. If I add a record  to a table, It does not plug in the user field with user id so it wont show up on the list page... Unless I actually type in the field value of the user ID.
but  It can work if add this,

  $xxx = USER_ID;
  $db->rawQuery("UPDATE invoices SET user=$xxx  WHERE id='$rec_id' ");

but shouldnt it fill this value if userid when I add a record with the add page on its own?

Is there a setting to check for this?

on authentication page there is a field call user and it is assigned to userid field.

on user record management I have user.user  and user

Am I setting this up wrong? maybe I have an issue wit reserved words or somnething?


thank you!