?
Solved

PHP MySQL Seek

Posted on 2014-02-12
4
Medium Priority
?
575 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 83

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 83

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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

800 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