Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7074689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:05:17+00:00 2026-05-28T06:05:17+00:00

So I’m posting $_POST[‘location’] using AJAX in my script.js file and the form on

  • 0

So I’m posting $_POST['location'] using AJAX in my script.js file and the form on the previous page. My problem is that this works in IE, but gives me the following error in ff and chrome:

Warning: my_data_seek() [function.mysql-data-seek]:
Offset 0 is invalid for MySQL result index 2 (or the query data is unbuffered)
in ...reserveAPickupAppointmentDateResults.php on line 39 

I know the data is in the database, but in the past, I’ve usually only gotten that error when the SQL returns no entries. I assume it is a problem with the SQL?

reserveAPickupAppointmentDateResults.php

<?php
session_start();

//create database connection
$connection = mysql_connect("XXXX","XXXX","XXXX"); 

//in case database connection fails
if(!$connection)
{
    die("Database connection failed: ".mysql_error());
}   
else
{
    //select database to use
    $db_select = mysql_select_db("XXXX",$connection);

    //in case database selection fails
    if (!$db_select)
    {
        die("Database selection failed: " . mysql_error()); 
    } 
    else
    {
        $appointmentLocation = mysql_real_escape_string($_POST['location']);
        $_SESSION["location"] = $appointmentLocation;

        $sql =  "SELECT timeBlocks.location, timeBlocks.date
        FROM timeBlocks
        WHERE timeBlocks.location = '".$appointmentLocation."';";

        //set results to variables
        $result = mysql_query($sql);
        if (!$result)
        {
            die("Database query failed: " . mysql_error()); 
        }

        $row = mysql_fetch_array($result);
        ?>

        <form class="reserveAPickupAppointmentForm5" id="reserveAPickupAppointmentForm5">
        <table>

        <?php
        mysql_data_seek($result, 0);

        while($row = mysql_fetch_array($result))
        {
            ?>
            <tbody class="reserveAPickupAppointmentDateResults">
                <tr>
                    <td>
                        <span class="reserveAPickupAppointmentDateText">
                            <img src="images/reserveAPickupAppointmentButton1.png" class="reserveAPickupAppointmentDate">
                            <?php echo $row["date"]; ?>
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>We have the following dates available for your location.  If you would like a different date, please choose "request a custom date" to try to schedule a custom appointment.  Otherwise, please choose a different date.</td>
                </tr>
            </tbody>
            <?php
        }
        ?>

        </table>
        </form>

        <?php
    }
}

// Close connection 
mysql_close($connection);
?>

Relevant scripting from formScript.js

$(".reserveAPickupAppointmentDateText").click (function() {
    appointmentLocation = $(this).text();
    $.post(
        'reserveAPickupAppointmentTimeResults.php',
        {
            'date': date,
            'location': appointmentLocation,
            'appointmentSize': appointmentSize
        },

        function (response)
        {
            $("#reserveAPickupAppointmentTimeResults").html(response);
        }
    );

    return false;
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:05:18+00:00Added an answer on May 28, 2026 at 6:05 am

    There is no reason for this to be browser specific, I suspect what is actually going on is that IE doesn’t render the error message whereas chrome and FF do. If you look in the source code, you will likely see the error message there under IE – if the generated source is different depending on the browser, something very odd is going on.

    A more important point is that your call to mysql_data_seek() is pointless and doesn’t do anything useful.

    You call:

    $row = mysql_fetch_array($result);
    

    But you never do anything with $row, then you call:

    mysql_data_seek($result, 0);
    

    before entering the loop. If you remove both of these lines, it will have no effect on the end result but should get rid of the error.

    EDIT

    If you really are getting different content generated in different browsers, then the problem is most likely that appointmentLocation in not being populated correctly in the Javascript in FF and Chrome, and as a result the SQL query is returning no results. In this case, you should examine the Javascript where you are assigning a value to appointmentLocation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.