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

  • SEARCH
  • Home
  • 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 7726535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:14:24+00:00 2026-06-01T05:14:24+00:00

SQL STRUCTURE CREATE TABLE IF NOT EXISTS `map` ( `id` int(11) NOT NULL AUTO_INCREMENT,

  • 0

SQL STRUCTURE

CREATE TABLE IF NOT EXISTS `map` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `x` int(11) NOT NULL,
  `y` int(11) NOT NULL,
  `type` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

http://localhost/map.php?x=0&y=0

When I update the x and y via POST or GET, I would like to pull the new data from the database without refreshing the site, how would I manage that? Could someone give me some examples, because I am really stuck here.

<?php


mysql_connect('localhost', 'root', '');
mysql_select_db('hol');

$startX = $_GET['x'];
$startY = $_GET['y'];
$fieldHeight = 6;
$fieldWidth = 6;

$sql = "SELECT id, x, y, type FROM map WHERE x BETWEEN ".$startX." AND ".($startX+$fieldWidth). " AND y BETWEEN ".$startY." AND ".($startY+$fieldHeight);

$result = mysql_query($sql);

$positions = array();

while ($row = mysql_fetch_assoc($result)) {
    $positions[$row['x']][$row['y']] = $row;
}

echo "<table>";
for($y=$startY; $y<$startY+$fieldHeight; $y++) {
    echo "<tr>";
    for($x=$startX; $x<$startX+$fieldWidth; $x++) {
        echo "<td>";
        if(isset($positions[$x][$y])) {
            echo $positions[$x][$y]['type'];
        }
        else {
            echo "(".$x.",".$y.")";
        }
        echo "</td>";
    }
    echo "</tr>";
}
echo "</table>"; 

?>
  • 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-06-01T05:14:25+00:00Added an answer on June 1, 2026 at 5:14 am

    You’ll need to use AJAX to update the content on the page without refreshing the page. I recommend using the JavaScript library jQuery.

    Example usage:

    $.ajax({
      url: 'path/to/file/file.php',
      success: function(data) {
        $('.content-to-update').html(data);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Structure: CREATE TABLE `links` ( `id` int(11) NOT NULL auto_increment, `title` int(11) default NULL,
I have the following structure SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; CREATE TABLE IF NOT EXISTS `sis_param_tax` (
I have the following database structure: CREATE TABLE LookupTable ( PK UNIQUEIDENTIFIER PRIMARY KEY,
I have the following table structure: CREATE TABLE a ( a_id int(10) unsigned NOT
i have got a problem with my SQL Statement: Table structure: CREATE TABLE tags
I've got a table with the following structure: CREATE TABLE mytable (column01 INTEGER NOT
What is the best way to translate the following problem in SQL table structure:
I have a table in SQL server that has the normal tree structure of
I have another rather curious problem. I have the following structure: CREATE TABLE [dbo].[Event]
I am trying to create an entity for the table structure given belos (id,

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.