SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Dec 2011
    Posts
    221
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    array get method in meta redirect

    greetings!

    Code:
    for($i = 0 ; $i < count($book); $i++)
    {
    
    $books = $book[$i];
    mysql_query("UPDATE tbl_bacquisition SET ba_Status = 'T1' WHERE id = '$bookac'") or die (mysql_error());							  
    
    echo "<meta http-equiv=\"refresh\"content=\"0;URL=Borrow_success.php?books[]=".$books."\">";	
    
    }
    I have a problem in passing array variable after updating my table. It shows only a single value of array.
    Any help will do. Thank you .

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    Hi claro

    When you do this
    PHP Code:
    $books $books[$i
    you get a multidimensional array. To not get a multidimensional array do this:
    PHP Code:
    $books[] = $i
    Steve
    ictus==""

  3. #3
    SitePoint Addict
    Join Date
    Dec 2011
    Posts
    221
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    thank you very much steve. It works now.

    But I found a new error it says like this:
    Code:
    Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\transaction\Borrow_success.php  on line 14
    What does it mean. Its my first time to encounter that error.

  4. #4
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    266
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I think that error appears when the script processes the code in the file for more then 60 seconds, or, perhaps it runs into an infinite loop, or redirect again and again to same file.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  5. #5
    SitePoint Enthusiast Belsnickle's Avatar
    Join Date
    Feb 2012
    Location
    Chico, CA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Without seeing more of your code we're not going to be able to give you a good idea of what's causing this but, take a look at your loop and find out what is determining $book, make sure it's not auto-incrementing with the rest of your loop since that error tends to indicate an infinite loop.

  6. #6
    SitePoint Addict
    Join Date
    Dec 2011
    Posts
    221
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    HERE IS MY CODE.

    PHP Code:
    <?php
    include'../connection/connect-db.php';
    $book $_GET['books'];
    for(
    $i $i count($book); $i++)
    {
    $book[] = $i;

    $query2 mysql_query("SELECT * , tbl_book.id AS bid, tbl_bacquisition.id AS bac
                               FROM tbl_book, tbl_bacquisition, tbl_bdetail  
                              WHERE tbl_bacquisition.ba_Accnum = '
    $book'
                              AND tbl_bacquisition.bd_Id = tbl_bdetail.id
                                 AND tbl_book.id = tbl_bdetail.b_Title"
    ) or die(mysql_error());
                                               
    }


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
  •