Join failed - entering "0" for ID

Hi,

I'm working on trying to get my registration system working with that multiple select on the country predefined list. I mentioned earlier  I finally got it so I am not getting database errors, but suddenly I am getting red "join failed" after I put in a test registration.  When I look in the database or in the members section, the ID field is "0" (zero).  Does anyone know why this might be, and how to fix it?

Thanks

Rob

Quote · 4 Aug 2008

Could anyone give me a hand on this- or at least have some ideas of things I might try?

The issue started when I put my multiple select country list in my registration- described in another thread.  As soon as this started working, other fields in profile builder started failing.  I put those back in one by one, and now almost everything works, but I can't get a new record in because the ID field won't increment- i.e.  it ends up being "0" and you can see it in both the phpadmin profiles table, and in the members section of the admin panel.

The second time, however, there will be a "duplicate ID" error message so something is wrong.  Does anyone have any thoughts on why this field is not incrementing?   Is there a setting in phpmyadmin I should change?   Any ideas?

Thanks

Rob

Quote · 5 Aug 2008

I'm getting a few hints on what may be wrong, but still haven't solved this.  I looked at my profiles table and saw that the default was 0 for the ID field- however in another Dolphin install that is working properly the default is blank.  Also, the "EXTRA" setting in the profile table for the ID field has the "auto increment" on in the working Dolphin, but it is off in the non-working Dolphin.  When I try to change this, I get an SQL error message:

#1062 - Duplicate entry '1' for key 1

Does anyone know what might be going on, and what I should try next?

Thanks

Rob

Quote · 6 Aug 2008

You need to ask the author of that mod since they know how it works  .....

Quote · 6 Aug 2008

I cannot understand the correct situation there in the site. I think you have changed the country list so that users can select multiple countries? Am I right?

Can you post the url here? That will be easy to understand the problem.

----
Quote · 6 Aug 2008

Hi Praveenkv,

Yes, I have a field called "trade_countries" that allows people to select multiple countries from the country predefined list, but I don't know if that is the issue.   I can't get a new registration I think because the "ID" field will not increment.  The url is www.caltrade.com/members

Rob

Quote · 6 Aug 2008

RumpyBumpy wrote:

"You need to ask the author of that mod since they know how it works  ....."

It's not really a mod, just a trick for getting a large multiple select list in the join form.  In any event, I don't think it is the problem (though I could be wrong).  Could someone just tell me what "#1062 - Duplicate entry '1' for key 1" means, and why I can't seem to turn on the "auto-increment" setting for the ID field in the profile table.  At this point, even a guess might help me- I am pretty much out of clues.

Thanks

Rob

Quote · 7 Aug 2008

You might try going to phpMyAdmin > trade_countries table and look at the
structure to se if the increment is set.

Quote · 7 Aug 2008

Thanks Rumpy.  Trade_Countries isn't a table, it is a field that uses the regular Dolphin country table with a #!country table in the field values part.

In any event, I don't know why that field would auto increment- none of the other fields do, except for ID, which seems to be the problem.   Back to the ol drawing board.

Rob

Quote · 7 Aug 2008

p.s. Could someone just tell me what the error message means: #1062 - Duplicate entry '1' for key 1

Is that referring to the Language settings area?  What is "Key 1"?

Thanks

Rob

Quote · 7 Aug 2008

It obviously has a primary or index field in it that is set to unique meaning can only contain one record.

Check the structure of the trade_countries table  .....

EDIT:  Check the structure of the countries table  .....

Quote · 7 Aug 2008

Rumpy, as I mentioned, there is no trade_countries table.  There is a trade_countries field, that refers to the normal Dolphin county table.  To elimate this as a possibility, I deleted that field (though it took me forever to get it to work) and I am getting the exact same error message when I try to enter a new record.  When I look in the profiles table I find it is because the last record I entered has an ID of 0, so I delete it.  When I try again to enter a record I don't get a database error, but I get a red "join failed" message - but the record goes in- again with an ID of 0.  As I said before, the difference between this profile table and a working copy I have is that this one has a "default" ID of zero, while the working copy has a blank default ID; and the "extra" parameter is blank while in the working copy the extra parameter is labled "autoincrement".   So the next thing I will typically try is to edit the ID field in the profile table- so that the default is blank and auto-increment is selected for the "extra" parameter.  When I do this, I get the message: #1062 - Duplicate entry '1' for key 1 .  Back to square one!  Does anyone have any clue as to what might be going on?

Thanks

Rob

Quote · 7 Aug 2008

Not obvious to me.  Wrote that last message before I saw Sammie's post.  Will try it now.

Rob

Quote · 7 Aug 2008

Sammie,

I couldn't see an option to repair the whole database, so I repaired the profile and profile fields tables- it didn't seem to have any effect.  I don't understand your last request- can I talk you into taking a look?

Rob

Quote · 7 Aug 2008

Sammie has been helping me track down this issue, but she is not all that familiar with Plesk.  As I mentioned, I have been able to find the "repair" function for individual tables, but not for the database as a whole.  I realize that most people don't like Plesk, but does anyone know where he "repair database" function is in Plesk?  I can't seem to find it.

Rob

Quote · 9 Aug 2008

AFAIK there is not a "repair all" for plesk databases and the only repair for is tables. That being said, here is a PHP script that will repair all tables. HTH .....


<?
### Enter your username and password into the connection string: ###
$dbLink = mysql_connect("localhost", "username", "password") or die("Unable to connect to the database.");

$sql = "show databases";
$query = mysql_query($sql) or die("error fetching database names");

while ($rs=mysql_fetch_array($query)) {

//echo "Database: " . $rs['Database'] . "\n";

mysql_select_db($rs['Database'],$dbLink) or die("Unable to select database: " . $rs['Database']);

$sql = "show tables";
$query2 = mysql_query($sql) or die("error fetching table names");

while ($rs2=mysql_fetch_array($query2)) {
$key = "Tables_in_" . $rs['Database'];
//echo "Table: " . $rs2[$key] . "\n";

$sql = "repair table " . $rs2[$key];
$query3 = mysql_query($sql) or die("Error repairing a table - $sql");
$rs3 = mysql_fetch_array($query3);
echo $rs3['Table'] . " | " . $rs3['Op'] . " | " . $rs3['Msg_type'] . " | " . $rs3['Msg_text'] . "\n";

}

}

echo "Finished!\n";

?>

HTH  ..... 
.

Quote · 10 Aug 2008

Thank you.

Quote · 10 Aug 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.