Solved

phpmyadmin select query returning a blank page.. why?

Posted on 2011-03-01
6
616 Views
Last Modified: 2012-05-11
I have this table in my database that has two columns with over 10,000 rows:

1) ID - int
2) Sessions - mediumtext

When I do a search query like the attached code below, the phpmyadmin page is returning a blank white page. Why is that? How could i fix this? If I do search in the ID column it is returning just fine.

I'm testing on a local machine with XAMPP installed btw.


SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'

Open in new window

0
Comment
Question by:Bandai2
6 Comments
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 35006204
The machine may be running out of execution time or memory. Check the apache error logs
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 35006215
Try adding LIMIT 5 to the query string and see if you get 5 results.  Then make it LIMIT 100, then LIMIT 1000, etc.  Your query has to read all of the text in the "Sessions" column and do some rather intense processing.  If the LIMIT statements work, then I'm expecting that your script may be timing out.  If the LIMIT statements return nothing, then you might want to check character encoding or something like that - a test case that you know for sure works would be helpful.
0
 

Author Comment

by:Bandai2
ID: 35006353
bportlock,

I've already increased the execution time and memory allocated to PHP.


Ray Paseur,

I've tried the limit to 5 results and it showed the results, but if I changed it to 10 or more it is displaying the white blank page again. How could I fix this timeout issue?

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 3

Expert Comment

by:pius_babbun
ID: 35006496
Try to execute the Query with php code mysql_query($query) where $query contains your actual query and you can use mysql_error() to get the data base error.Hope it helps
$conn   	= mysql_connect('hostname','db user name', 'db password');
$database	= mysql_select_db('database_name');
$Query  	= "SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";
$Result 	= mysql_query($query) or die('Mysql Error :' .mysql_error());    //SHOW QUERY ERROR

Open in new window

0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 35006642
If each record does not already have a unique ID code then add one and alter your query from

"SELECT * FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";

to something more like

"SELECT id FROM current_session WHERE sessions LIKE '%SESSIONIDHERE_LONGTEXT%'";

so that you do not use up large amounts of memory in result sets. You can always retrieve each record on an individual basis using its ID
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 35007356
I second this idea - ID:35006642 - and I would like to suggest that you try it again with the gradually increasing LIMIT clauses.  You may find that this solution works, or you may find that the requirement to do the fulltext table scan is just too much work to complete in a reasonable amount of time.

Do you have fulltext index on the sessions column?  Have you tried EXPLAIN SELECT to see if it has any suggestions for you?
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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