Update Syntax

Home Forums Quform PHP Update Syntax

This topic is: not resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #19251
    davidjwest
    Participant

    Hi,

    I have the code working for updating the database but I also want to use the code to allow users to edit their entries, so I need it to do updates too.

    Can you give me an example of the syntax to do an update please as I am not familiar with OO syntax for db operations.

    Thanks.

    #19261
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    • This reply was modified 8 years, 5 months ago by Ally.
    #19303
    davidjwest
    Participant

    Thanks Ally.

    This doesn’t work for me but it could easily be my code – how can I get the query to display somewhere so I can debug it?

    I can’t echo it as that page isn’t actually displayed.

    Thanks.

    #19313
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19321
    davidjwest
    Participant

    Thanks.

    It appears that the product ID isn’t being passed from the form script, I have the details in a hidden field:

    <input type=’hidden’ name=’pid’ value=’3′>

    And then this in the process-all-elements.php file:

    $pid = $_POST[‘pid’];

    But it isn’t getting set, do I need any validation etc?

    #19324
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19362
    davidjwest
    Participant

    Thanks – yes, here’s a link

    http://vapourlove.co.uk/edit_multiple.php?pid=3

    Obviously the value in pid changes and that populates the hidden value in the form, I can see it in the source code.

    #19376
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19407
    davidjwest
    Participant

    Yeah I get this:

    [“pid”]=>
    string(1) “3”

    #19408
    davidjwest
    Participant

    But when I assign it, the value isn’t showing up.

    ie:

    $pid=$_POST[‘pid’];

    Isn’t assigning a value to $pid.

    #19414
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy