you aren't assigning your array a correct index. you're using i when you should be using $i. only thing I could think of. never used extract() with a query before, so if it still isn't working or if that was just some typo on your part, you can always try using $row['tip'] instead.