Quick Functions Problem

Discussion in 'PHP' started by Pixel T., Jul 24, 2010.

Thread Status:
Not open for further replies.
  1. #1
    Hey guys,

    I'm trying to run a function() inside of a

    while($row = mysql_fetch_array($result))
    PHP:
    which is causing the function to happen more than once. I need to run it every time I fetch something from the database with multiple rows. Yet I can only use the function once. Is there anyway around this?

    If you guys need the whole code, let me know.

    Thanks,
     
    Pixel T., Jul 24, 2010 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #2
    ^^ ya, post the whole code.
     
    gapz101, Jul 24, 2010 IP
  3. themullet

    themullet Member

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    use require_once / include_once or

    $i = 0;
    while ($row = mysql_fetch_array($result)) {
    if ($i==0)
      $i++;
     if ($i==1) {
      include('function.php'); 
      $i++;
     }
    }
    PHP:
     
    themullet, Jul 24, 2010 IP
Thread Status:
Not open for further replies.