MYSQL command line returns empty set but fine on website

 
Post new topic   Reply to topic    Aprelium Forum Index -> Databases
View previous topic :: View next topic  
Author Message
Seiryu
-


Joined: 17 May 2016
Posts: 1

PostPosted: Tue May 17, 2016 11:09 pm    Post subject: MYSQL command line returns empty set but fine on website Reply with quote

Hi,

Have installed the Abyss web server to help with building my website database and generally learn PHP / SQL. I am quite new to this, so still finding my way.

I now have the server and SQL databses and tables set up. However, I have a small issue whereby sometimes a direct query (typed straight into the command line) returns an empty set with thousands of warnings. However, this database and table (and query) appears to be fine as the website itself loads data from the table fine in the browser.

On the flip side, sometimes I have an issue whereby the query will return all rows except the first on the website itself but the query into the command line will display fine. This seems to happen when I add and then delete some entries. I'm struggling to figure out exactly what is causing this. The entries are all checked for characters etc (it's only me inserting at the moment for testing).

What could cause this and why would one method work but not the other and then the opposite? ie. Website loads data fine, but command line shows error, or website misses first entry but command line displays fine?

For reference, I'm using 'SELECT * FROM table_name;'. The problem is certainly server side as the JSON returned has been tested in the browswr (where the first line is missing) and my PHP code has been checked and does not seem to be the issue.

Where do I begin to debug / repair this and would you have any idea what may cause this? Are there any tests I can do on the server, and is there a refresh etc function which will perhaps repair anything wrong with the database if this is what is required?
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 772

PostPosted: Wed Jun 01, 2016 5:58 pm    Post subject: Re: MYSQL command line returns empty set but fine on website Reply with quote

Seiryu,

This looks like a database issue and probably related to the PHP code you're using to process data returned by SELECT queries.

It would greatly help if you focus on a single query that generate errors and explain us in detail what you do and how these quieries are run (tools/scripts/exact error-warning messages.)
_________________
Forum Administrator
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Databases All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group