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 7694777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:23:46+00:00 2026-05-31T21:23:46+00:00

Using phpMyAdmin and running the following query I get 19 registers: SELECT * FROM

  • 0

Using phpMyAdmin and running the following query I get 19 registers:

SELECT * FROM trayecto tr, lugar lu WHERE idAeropuerto = '3' AND tr.idLugar = lu.idLugar GROUP BY tr.idAeropuerto, tr.idLugar ORDER BY lu.nombre

but running this query in the website obtaining the data throw and PHP call I only get 18 registers (all of them but the last one entered in the database).

$q=$_GET["q"];
include('init_bd.php');
$selectLugaresDeAeropuerto="SELECT * FROM trayecto tr, lugar lu WHERE idAeropuerto = '".$q."' AND tr.idLugar = lu.idLugar GROUP BY tr.idAeropuerto, tr.idLugar ORDER BY lu.nombre";
$resultLugaresDeAeropuerto = mysql_query($selectLugaresDeAeropuerto) or die('Consulta fallida: ' . mysql_error());
echo "<SELECT SIZE='1' NAME='Lugar'>";
while($row = mysql_fetch_array($resultLugaresDeAeropuerto))
{
  printf("<OPTION VALUE=%s>%s</OPTION>", $row["idLugar"], $row["nombre"]);    
}
echo " </SELECT>";
mysql_free_result($resultLugaresDeAeropuerto);
include('close_bd.php');

You can execute this PHP to see the result:
http://www.transferbus.com/bd/getLugar.php?q=3

I have a MySQL Database with the following tables and structure:

TRAYECTO

idAeropuerto - int(8)
idLugar - int(8)
idTipoTransporte - int(8)
precio - double
tiempo - varchar(5)
distancia - varchar(5)

LUGAR

idLugar - int(8) - auto_increment
nombre - varchar(40)

Any idea why I get different results with same-like query?

  • 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-31T21:23:47+00:00Added an answer on May 31, 2026 at 9:23 pm

    You are connecting to two different databases. Contact your web provider if you need help with connecting to the correct database.

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

Sidebar

Related Questions

Im running the following query from my PhpMyadmin sql tab CREATE TRIGGER testTrigger AFTER
I'm using phpMyAdmin to query the database. I want to select all the entries
Using PHPMyAdmin, I am trying to import a file via the following syntax... LOAD
I am using phpMyAdmin. In order to set up a foreign key constraint with
I'm using phpmyadmin and working on someone site whose information is pulled from a
I'm running the following command within PHPmyadmin: LOAD DATA INFILE '/test3.csv' INTO TABLE temp_car
I'm using phpMyAdmin, and I'm attempting to duplicate the database from one database to
I am running the following command in PHPMyAdmin: DELIMITER # CREATE PROCEDURE addid() BEGIN
When using phpMyAdmin or the MySQL GUI Tools, whenever I create an InnoDB table,
I'm using PHPMyAdmin and I've got a MySQL table column called timestamp. The type

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.