Jump to content
ober

Phpmyadmin and other PHP tools do not agree

Recommended Posts

I have a table where users insert table via a form (this is done through a Joomla module).  When I view that table in phpmyadmin, it only returns 73 rows.  Yet when I view the data via the module itself (there is an output portion), there are 140 rows... which is what I am expecting.  I even looked at the mysql schema tables and it only sees the 73 rows.  Yet I even installed another module that pulls data based on SQL queries and THAT module also sees the 140 rows.

 

Does anyone know why phpmyadmin or my own PHP script on another page would not see all of the records?  I already tried repairing, flushing, and optimizing the table... all to no avail.  I'm running out of ideas.

 

HELP?

Share this post


Link to post
Share on other sites

Do you have a root access to the file server where the DB is deployed?

Share this post


Link to post
Share on other sites

No, I don't have root access.  Why do you ask?

Share this post


Link to post
Share on other sites

If you had you can easily check if the content exists in mysql  without running any GUI database tools.

echo "SELECT COUNT(*) FROM db_name.tbl_name WHERE 1" | /usr/bin/mysql db_name

What about the mysql command line tool? Are you able to use it?

 

Try next:

echo "SELECT COUNT(*) FROM db_name.tbl_name WHERE 1" | /usr/bin/mysql db_name -u userName -ppassword -h hostaddress 
Edited by jazzman1

Share this post


Link to post
Share on other sites

Hey ober, long time no see.

 

Out of curiousity, does this table use the myisam engine, or innodb or some other engine?

Share this post


Link to post
Share on other sites

Hey gizmola, good to be back.  I live mostly in the Java world these days so I haven't had much reason to stop in here.

 

I also posted this on another forum and they brought up an interesting theory.  When this started to become a problem, I had just recently moved that website from my hosting account to a separate account under my reseller plan with my host.  One of the other guys suggested that it might just be a permission problem, but I don't know how to solve it.  Clearly the data is all there but I guess my user can't access some of the records for some reason.

Share this post


Link to post
Share on other sites

is the database server ip (or hostname resolution) the same in all the scripts/tools? this symptom is screaming data from two different database servers.

Share this post


Link to post
Share on other sites

Please disregard.  I'm an idiot.  I was viewing the data in phpmyadmin through my account, not the new account and I was viewing the old copy of the DB.  I also had the website on the new account pointing to the old database as well, hence the new data not showing up.

 

*sigh*  I should stop working so late at night.  Thanks everyone for your help.

Share this post


Link to post
Share on other sites

Hehe, no worries man, we have all been there.  Glad to see you are still alive and kicking, and doing the Java thing. 

 

The PHP world has really exploded since the major frameworks guys got together and put together some standards for library autoloading, and we have this great tool composer now that allows you to install and use libraries together, that makes php comparable to ruby, node and python finally.  Some great stuff in the frameworks area too, like Symfony2 and Zend Framework2 (both ground up rewrites) heavily inspired by Spring and similar Dependency Injection frameworks. 

 

PHP doesn't feel as dirty as it used to.

Share this post


Link to post
Share on other sites

I still sorta live in the PHP world.  I build websites on the side for a few clients but I stay away from most of the libraries as far as PHP.  I have a CMS-ish/framework-ish thing that I built on my own a few years ago that has held up well over time and I keep tweaking it.  I just hate the 'locked in' feeling of most frameworks so I tend to go more custom.  The main PHP libraries I use these days are for the DB (www.phpactiverecord.org).  That plus several JS libraries (jquery, extjs, and datatables) which allows me to drop some PHP code in favor of some front-end awesomeness has allowed me to whip through some projects pretty quickly. 

 

I never really thought of PHP as 'dirty', but it's definitely less strict than Java (I would still do PHP full time if I can find the right gig at the right salary). 

 

Anyways, I might pop in from time to time.  Good to see some of the old crew is still here.

Share this post


Link to post
Share on other sites

I know it's hard to throw away stuff you know and are productive with.  If you get some time play with symfony2.  So much goodness in there, and tremendous velocity in terms of support.  Lots of other projects are using the core symfony2 components.  Drupal and phpbb for example are both well into rewrites using the components, and then you have other frameworks like laravel using a lot of their core.

 

Even if you don't ever want to go to a framework, it's really worth looking at your personal stack and figuring out how to move it to component libraries and PSR-0 compatibility.  You can do this easily enough by setting up your libraries in github and learning the basics of composer.  You can then get access to all the libraries out there, and mix them into your ongoing work.

 

I've recommended this presentation to lots of folks: 

 

This is the lead documentation guy for Symfony2, and just does a great summary of the history of this, and goes over a few of the core symfony2 components, showing how you can easily explore them individually.

 

The same guy has an online training site, and they offer up a number of free webcasts that are worth watching for 5 mins:

 

Namespaces was the important facilitating addition to php: http://knpuniversity.com/screencast/php-namespaces-in-120-seconds

Composer: http://knpuniversity.com/screencast/composer

 

I need to fix the borked phpfreaks home page and post up this info one of these days.

Share this post


Link to post
Share on other sites

You have no idea how much I appreciate the additional info.  Most people just say 'hey... use this!' and that's all you get.  I guarantee I will check that stuff out.

 

The only thing I worry about is adding it into my current setups or having to start over from scratch.  When I use PHP these days, I have to be extremely efficient.  I don't have the luxury of taking 3 full days of work to figure stuff out and implement it.  That's time lost on extra income for me.  I have another buddy of mine trying to convince me to abandon my research on Bootstrap and start using http://foundation.zurb.com/

 

I would kill to be using all of the latest stuff, but I can barely keep up and crank through my existing workload!  I mean I know some of this stuff will eventually greatly enhance my efficiency so I should just invest the time but I haven't yet.  But I will.  Thanks for a gentle kick in the pants, sir.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.