Author Topic: CRUD - Create, Retrieve, Update, Delete to Database  (Read 647 times)

STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
CRUD - Create, Retrieve, Update, Delete to Database
« on: July 06, 2022, 10:35:44 pm »
Dear Paramvir,

The product example explained in tutorial doesn't update/delete/create data to the table. 
It can only retrieve data from the database. I just followed your tutorial but I don't know where I made mistakes.

please check my codes in the attachement as below

Best Regards,
Steve.
« Last Edit: July 06, 2022, 10:40:22 pm by STEVE »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
« Last Edit: July 07, 2022, 10:06:06 am by paramvir »

STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #2 on: July 07, 2022, 06:45:59 pm »
Dear paramvir,

I am beginner not like you.  It is really hard and tough.  Almost I was to cry.

Would you give me these sample files?

Why didn't you post the sample files on these pages.  I was always confused whenever I was reading it.

Please be nice to me.  I don't know at all.  Please save the time.

Best regards,
Steve.   

STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #3 on: July 07, 2022, 08:01:04 pm »
It can only retrieve data from the database.

please see the attachment.
« Last Edit: July 07, 2022, 08:20:34 pm by STEVE »

STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #4 on: July 07, 2022, 09:12:40 pm »
It is also same results.

It can only retrieve. CUD is not working.

please see the attachment.



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #5 on: July 08, 2022, 10:00:26 am »
Dear Steve

Please check this comment in the source code. (saveauto.php)

Code: [Select]
//JSON.stringify not required for PHP
list: JSON.stringify( gridChanges )

so change your source code to

Code: [Select]
list: gridChanges

instead of

Code: [Select]
list: JSON.stringify( gridChanges )
« Last Edit: July 08, 2022, 10:07:24 am by paramvir »

STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #6 on: July 08, 2022, 05:30:51 pm »
Finally, It is working now!!!!

Thank you  Paramvir.


STEVE

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #7 on: July 09, 2022, 01:21:22 pm »
Hello paramvir,

I changed some lines of the source code of products.php. The changed parts were related to a table.

I could see the data but I couldn't update/delete/insert.

I got the error message from the log folder.

Quote
   VirtualProtect() failed [87] parameter is wrong.

I wan to know how to debug this problem.   and how to see the data which is producing through each line of the source code.

I am going to attch the source codes.  Please see below.

Best regards,
Steve.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: CRUD - Create, Retrieve, Update, Delete to Database
« Reply #8 on: July 11, 2022, 10:17:40 am »
It's your environment specific issue.

Please use xdebug to debug your code and find out which line is causing the error.