SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: php array

  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php array

    My update array is not working any help


    for ($i = 0; $i < count($_REQUEST['rowid'])+1; $i++) {
    $rowid = $_REQUEST['rowid'][$i];
    $query = mysql_query("UPDATE products SET
    products_kelkoo_date = '$_REQUEST[products_kelkoo_date]',
    products_kelkoo_price = '$_REQUEST[products_kelkoo_price]',
    products_price = '$_REQUEST[products_price]',
    products_best_date = '$_REQUEST[products_best_date]',
    products_best_price = '$_REQUEST[products_best_price]',
    products_best_name = '$_REQUEST[products_best_name]',
    products_notes = '$_REQUEST[products_notes]' where products_id =$rowid[0]");
    $result = mysql_query($query) or die ("Couldn’t execute query" .mysql_error());}

  2. #2
    SitePoint Addict
    Join Date
    Apr 2005
    Location
    San Diego, CA
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like you're running mysql_query() twice. Either remove the first mysql_query so you're assinging the string to $query or the 2nd mysql_query.
    I study speed waiting. I can wait an entire hour in 10 minutes.

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cany you type in which bit to remove

  4. #4
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the help, got it working.

    just a simple one, when tthe update is complete i want to add "update complete click bla bla to go back"

    where do i echo this

    $result = mysql_query($query) or die ("Couldn’t execute query" .mysql_error());
    }

    echo "Update Complete <a href='price.php'>Click here</a> to go back";

    or this correct

  5. #5
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did it do what you want when you tried it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •