Solved

PHP MySQL Seek

Posted on 2014-02-12
4
554 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 83

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 83

Expert Comment

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

Expert Comment

by:Ray Paseur
ID: 39861962
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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