Hello,
I am very interested in using (and developments) of this
package. After installation and configuration of db I use
with another admin (i developped myself), I always get
this message when editing/deleting records in my (only)
registered db.
Error : DB Error: no such table
remarks :
- everything is working fine for the main database
(phpfriendlyadmin)
- displaying & printing records is ok
- tables are defined
- fields are defined
- adding a record is ok
- thishappens for
I added some "pointers" in the code & this is the point
where the error arrives (when trying to EDIT a record of
the 'user' db):
file : main_classes/Edit.php
$sql query = "select * from [my first registered db]
where id_field = '8' (which is the correct id i would like
to edit/erase)
This query should be ok. but apparently pointing to a
bad db ???!
//NAME: requireeditid //PURPOSE: Makes sure that delete page has a
editid defined, otherwise sends user back to browse
tables
function requireeditid($maindb) {
$db = $maindb->constring();
$sql = "SELECT * FROM " . $this-
>currenttable->dbtablename . " WHERE " . $this-
>currenttable->findid() . " = '" .
phpFriendlyAdmin::validateurlvars($_GET['editid']) . "'";
$result = $db->query($sql);
if (DB::isError($result))
die ("Error : " . $result-
>getMessage() . "\n");
if \($result->numRows\(\) \!= 1\) $found = false; else $found = true; if \(\(phpFriendlyAdmin::validateurlvars
($_GET['editid']) === false) ||
(phpFriendlyAdmin::validateurlvars($_GET['editid'])
== "") || ($found == false)) {
$location = "Location:
index.php?currenttable=" .
phpFriendlyAdmin::validateurlvars($_GET
['currenttable']) . "&" . SID;
header($location);
exit;
}
}
Thanks forany help !
Jack
pfa@jackanova.net
Logged In: NO
*********************************************
Everything going fine IF my registered db is the same as the
main db (all tables in the same db)
is it normal ? or is it required to use only 1 db ?
Thanks !
*********************************************
Logged In: YES
user_id=1078591
Hi, I had the exact same problem, you can solve it by
changing some lines in the main_classes/User.php file.
Change this:
WHERE " . $currenttable->findid() . " = '" . $primarykey . "'";
into this:
WHERE " . $currenttable->findid() . " = '" . $primarykey . "'";
the problem was that it was always using the main database
to find the table you were working on. This also solves the
same problem when trying to use the trashcan icon too!