[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

PHP MySQL Seek

Posted on 2014-02-12
4
Medium Priority
?
582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

Expert Comment

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

Expert Comment

by:Ray Paseur
ID: 39861962
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this article, we’ll look at how to deploy ProxySQL.
The viewer will learn how to dynamically set the form action using jQuery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

649 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