Solved

PHP MySQL Seek

Posted on 2014-02-12
4
549 Views
Last Modified: 2014-02-15
Anyone know why this doesn't work?  I want to use this code to list the data twice.

$result = mysqli_query($objConnection, $query);

while($row = $result->fetch_assoc()){
  List all results
  // This works
}

mysql_data_seek($result, 0);

while($row = $result->fetch_assoc()){
  List all results
  // This DOES NOT work
}
0
Comment
Question by:classnet
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39855268
The first problem is that mysql_data_seek is not part of the 'mysqli' driver.  'mysql' and 'mysqli' functions do not work together, it's one or the other, not both.  You might be able to use 'mysqli_data_seek' instead.  http://us1.php.net/manual/en/mysqli-result.data-seek.php
0
 

Author Closing Comment

by:classnet
ID: 39855752
This little answer went a long way... need to watch the l and i.

Thanks
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39856844
You're welcome, glad to help.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39861962
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now