Jump to content

[SOLVED] Can't Query Table


niconico

Recommended Posts

I'm wondering what could be wrong with a new table I created, which I can't query in any manner.  Even phpmyadmin can't query this table.  All other tables I've created work fine and I can SELECT, INSERT or UPDATE without any difficulty.

 

Does this indicate a particular problem that I should be looking into?

 

Link to comment
Share on other sites

I got frustrated, dropped the table and rebuilt it.  It's fine now.  I've never experienced that kind of corruption before.  I've noticed that my host is running a bad/hacked/? version of phpmyadmin.  I wonder if that had anything to do with it.  Using the Insert Button and submitting the data results in the following:

 

Warning: Invalid argument supplied for foreach() in /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php on line 147

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/ob.lib.php on line 64

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_http.inc.php on line 13

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_http.inc.php on line 14

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_http.inc.php on line 15

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_http.inc.php on line 16

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/tbl_replace.php:147) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_http.inc.php on line 19

Link to comment
Share on other sites

I'm embarrassed to learn the cause of the original problem.  I created the tables manually in phpmyadmin based on a schema borrowed from  and MS Access application.  Apparently phpmyadmin will allow you to create/name a table using a reserved word, which in this case was 'order'.  Duh, no wonder I couldn't query the table.  When I dropped and rebuilt the table I selected 'purchase' as a new name since it seemed more in context with the application.  This is the reason the query starting working again. 

Link to comment
Share on other sites

I'm embarrassed to learn the cause of the original problem.  I created the tables manually in phpmyadmin based on a schema borrowed from  and MS Access application.  Apparently phpmyadmin will allow you to create/name a table using a reserved word, which in this case was 'order'.  Duh, no wonder I couldn't query the table.  When I dropped and rebuilt the table I selected 'purchase' as a new name since it seemed more in context with the application.  This is the reason the query starting working again. 

 

Yes, I've always hated that every single freakin' application puts backticks around every string literal -- masking the fact that reserved keywords are used (desc for description is my personal favorite).  FWIW, I always include an underscore in my field names, which prevents 99.9% of accidental reserved keyword usage -- especially for newer keywords for SP, like "start".

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.