Index
» Projekty
» phpMyEdit
» Fórum
» Another MySQL error 1064 - change or delete |
|
nelliott
Založený: 24.09.2009
Príspevky: 3
Zaslal: 2009-09-24 20:11
Návrat hore
Odpovedať s citátom
|
I read about restricted table or column names, and the use of a hyphen in database names...but none of that seems to apply to my situation.
When trying to delete I get this error and the delete fails:
Citácia: |
MySQL error 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index = 276)' at line 1 |
I can ADD entries just fine.
The edit page loads properly and everything looks beautiful. I can CHANGE entries, but I get the error above PLUS this additional error when doing a change:
Citácia: |
Warning: Invalid argument supplied for foreach() in /var/www/phpMyEdit-5.7.1/phpMyEdit.class.php on line 2731 |
I tried recreating the page using phpMyEditSetup.php thinking perhaps some of my simple edits were goofed up, but the new page reports the same error.
|
nelliott
Založený: 24.09.2009
Príspevky: 3
Zaslal: 2009-09-24 23:31
Návrat hore
Odpovedať s citátom
|
I can't say I am sure I understand exactly what happened here, but here is how I fixed it:
In order to figure this out, I changed line 368 of phpMyEdit.class.php to enable debug messages:
Kód: |
function myquery($qry, $line = 0, $debug = 1) /* {{{ */ |
Which showed me that the SELECT statement was being generated properly, but the DELETE statement was missing the single-quotes from the table name. Here is my updated line 2776 of phpMyEdit.class.php:
Kód: |
$query = 'DELETE FROM '.$this->sd.$this->tb.$this->ed.' WHERE '.$this->sd.$this->key.$this->ed.' = '.$this->key_delim.$this->rec.$this->key_delim.''; |
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2009-09-26 14:17
Návrat hore
Odpovedať s citátom
|
Do the names of your tables and/or columns contain spaces?
|
nelliott
Založený: 24.09.2009
Príspevky: 3
Zaslal: 2009-09-26 20:38
Návrat hore
Odpovedať s citátom
|
Nope, no spaces or special characters or even numbers.
|
arslan1
Založený: 21.12.2014
Príspevky: 2
Zaslal: 2014-12-21 08:36
Návrat hore
Odpovedať s citátom
|
Do the names of your tables and/or columns contain spaces?
_________________________________________
Arslan1
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|