Hi,
I really like AppGini and still experimenting it before some serious work.
I wonder how to update another table in my project using hook "tablename_before_delete()"function
because it's missing the $data parameter, is this still possible? I would like to use my current view field information
in my update query just before deleting it?
I would appreciate any help.
Thanks!
Update another table in project using _before_delete
-
- Posts: 6
- Joined: 2014-03-30 20:42
-
- Posts: 6
- Joined: 2014-03-30 20:42
Re: Update another table in project using _before_delete
Addition to my first question could someone also explane this abit:
"...line 7 the use of the makeSafe() function which prepares variables to be used safely inside SQL queries."
(http://bigprof.com/appgini/help/advance ... ific-hooks) .
More specifically why it has to be make "safe"?:)
"...line 7 the use of the makeSafe() function which prepares variables to be used safely inside SQL queries."
(http://bigprof.com/appgini/help/advance ... ific-hooks) .
More specifically why it has to be make "safe"?:)
-
- Posts: 10
- Joined: 2013-06-04 21:26
Re: Update another table in project using _before_delete
research 'sql injection'
-
- Posts: 6
- Joined: 2014-03-30 20:42
Re: Update another table in project using _before_delete
Ok, I thougt it would be something to do with security. I'm not so familiar with PHP methods so I did not know where to relate this.albuchholz wrote:research 'sql injection'
Thank you albuchholz.
I have tried to run this query in participants_before_delete():
Code: Select all
$id=makeSafe($SelectedID);
$result=sqlValue("SELECT ticket FROM participants WHERE id='$id'");
mysql_query("UPDATE tickets SET left=left+1 WHERE ticketID='$result'");
-
- Posts: 6
- Joined: 2014-03-30 20:42
Re: Update another table in project using _before_delete
AH! rigth way to query this wasgoing4code wrote:Ok, I thougt it would be something to do with security. I'm not so familiar with PHP methods so I did not know where to relate this.albuchholz wrote:research 'sql injection'
Thank you albuchholz.
I have tried to run this query in participants_before_delete():
I just dont get this guery to adderss right ID in myt tickets tableCode: Select all
$id=makeSafe($SelectedID); $result=sqlValue("SELECT ticket FROM participants WHERE id='$id'"); mysql_query("UPDATE tickets SET left=left+1 WHERE ticketID='$result'");
Code: Select all
$result=sqlValue("SELECT ticket FROM participants");
Code: Select all
$id=makeSafe($SelectedID)
Could someone kindly explane me if I need it to make this query safe, or if not when I need it?
Re: Update another table in project using _before_delete
That part (using makeSafe function) is important in case the value of $SelectedID contains some SQL special characters like single quotes for example.becouse it's working fine with out it
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
-
- Posts: 6
- Joined: 2014-03-30 20:42
Re: Update another table in project using _before_delete
Ok, thanks.a.gneady wrote:That part (using makeSafe function) is important in case the value of $SelectedID contains some SQL special characters like single quotes for example.becouse it's working fine with out it