Jump to content

Phpmyadmin and other PHP tools do not agree


ober
Go to solution Solved by ober,

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?

Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

  • Solution

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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.