Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts

    How to clear parameter values

    For the code below, how do I clear the values of $code[], $type[], $description[] after each "for" loop run?

    Thank you.

    PHP Code:
    for ($coun=1000$coun<1200$coun ++) {

    $nu="A" $coun;
    $extract=mysql_query("SELECT * FROM $table WHERE code='$nu' ORDER BY id ASC");
    $number=mysql_numrows($extract);

    while(
    $row mysql_fetch_array($extract)){
    $number[]       =$row['number'];
    $type[]       =$row['type'];
    $description[]=$row['description'];
    }

    ***
    codes to display the $number$type, and $description***


    Last edited by camaross; 11-09-2011 at 02:42 AM.

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    PHP Code:
    unset( $number$type$description ); 

  • Users who have thanked kbluhm for this post:

    camaross (11-09-2011)

  • #3
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts
    Thank you so much for the reply.

    It works great!


    Quote Originally Posted by kbluhm View Post
    PHP Code:
    unset( $number$type$description ); 


  •  

    Posting Permissions

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