ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

CP Home not displaying

April 28, 2008 4:18am

Subscribe [1]
  • #1 / Apr 28, 2008 4:18am

    Nelson @ Evoflux

    32 posts

    Okay here is the deal. When I log in I have nothing displayed in CP Home. When I goto ‘My Account’—> ‘Customize Control Panel’—> ‘Control Panel Homepage’ I try and modify the settings. Anytime I click update after choosing anything (and I do mean anything) all the ‘Home Page Preferences’ disappear and only the update button is available. Nothing changes in CP Home. Its still a blank section with the exception of the header and the footer. If I go back and try again the second time I would click ‘Update’ after everything disappears I receive the error message:

    ==========
    MySQL ERROR:

    Error Number: 1064

    Description: 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 ‘WHERE member_id = ‘2’’ at line 1

    Query: UPDATE `exp_member_homepage` SET WHERE member_id = ‘2’
    ==========

    This occurs for either the classic or default CP themes available. Its a fresh install of EE 1.6.3 mainly due to some problems I was running into getting phpbb to the new EEforums. The only other detail I can think of is that I’ve deleted the original super admin account and replaced it with a second one.

    I do like having a useful CP Home and would love it if this works again. Nothing I’ve been able to search the EE site for is able to explain and/or fix this issue.

  • #2 / Apr 28, 2008 10:01am

    Robin Sowell

    13255 posts

    It almost looks like the post array got wiped- hence the error in the mysql.  Can you get to the publish tab- and can you publish a new entry?  Also- in the url on the ‘My Control Panel’ pages- what’s the id?  Mine looks like: &id=1.

  • #3 / Apr 28, 2008 11:54am

    Nelson @ Evoflux

    32 posts

    It almost looks like the post array got wiped- hence the error in the mysql.  Can you get to the publish tab- and can you publish a new entry?  Also- in the url on the ‘My Control Panel’ pages- what’s the id?  Mine looks like: &id=1.

    Hey Robin. I can publish a new entry and have it show up on the main site. Also I don’t see an ID when I goto ‘My Control Panel’. Its just the standard URL for me (i.e., .../index.php/member/profile/).

  • #4 / Apr 28, 2008 11:57am

    Robin Sowell

    13255 posts

    Ah- we’re talking about the frontend of the site?  I was thinking backend.  So in the backend- everything shows fine.  You can get to ‘My Account’ and ‘CP Home’ and what have you- and make edits there no problem?

  • #5 / Apr 28, 2008 12:14pm

    Nelson @ Evoflux

    32 posts

    Apologies I was up late last night. I was referring to the backend. When you referred to navigating to “My Control Panel” I saw that as “Your Control Panel” settings. I can make edits to almost everything in ‘My Account’ with the exception to “Customize Control Panel”. Everything is initially set to “do not display” and cannot be changed.

    Just to clarify this is what I see when I log into the control panel.

  • #6 / Apr 28, 2008 12:34pm

    Robin Sowell

    13255 posts

    Hm- flip over and take a look at the db tables- can see them in ‘Admin- Utilities- SQL Manager- Manage DB tables’- do you have the same number of records for exp_members and exp_member_homepage?

  • #7 / Apr 28, 2008 12:53pm

    Nelson @ Evoflux

    32 posts

    Hm- flip over and take a look at the db tables- can see them in ‘Admin- Utilities- SQL Manager- Manage DB tables’- do you have the same number of records for exp_members and exp_member_homepage?

    Hah. No I do not.

  • #8 / Apr 28, 2008 4:23pm

    Nelson @ Evoflux

    32 posts

    Is there a way to rebuild that without having to reinstall? running a ‘repair selected tables’ doesn’t do any good.

  • #9 / Apr 28, 2008 4:45pm

    Ingmar

    29245 posts

    You can try to perform a recount: CP Home ›  Admin ›  Utilities ›  Utilities
    Not sure it’ll actually solve the issue for you, but it certainly can’t hurt.

  • #10 / Apr 28, 2008 5:11pm

    Nelson @ Evoflux

    32 posts

    You can try to perform a recount: CP Home ›  Admin ›  Utilities ›  Utilities
    Not sure it’ll actually solve the issue for you, but it certainly can’t hurt.

    I wish it were that simple :shut: . Thank ya for the recommendation though. No go.

  • #11 / Apr 29, 2008 12:16pm

    Robin Sowell

    13255 posts

    You still jammed up on this?  Would be pretty easy to do w/a php loop, but I won’t dig into the code if you’ve already done it manually.

  • #12 / Apr 29, 2008 12:36pm

    Nelson @ Evoflux

    32 posts

    You still jammed up on this?  Would be pretty easy to do w/a php loop, but I won’t dig into the code if you’ve already done it manually.

    I’m still stuck. I have a list to do and it isn’t on the top, but that doesn’t mean I would cross it off right away given the chance. I haven’t done it manually either. I’m more of a designer than a programmer so learning php has been due to forced circumstances. What do you recommend?

  • #13 / Apr 29, 2008 1:10pm

    Robin Sowell

    13255 posts

    OK- going to shift over to ‘How to’ since we’re getting into custom code.  And back up - and be comfortable rolling back- before poking the db manually.

    Looking at it- and I did a quick test- this should output all of the queries needed.  It won’t DO anything- the bits that perform the query are commented out.  But it will show the queries that should run- and give you a final count at the end:

    <?php
    global $DB;
    $i=0;
    
    $query = $DB->query("SELECT member_id FROM exp_members");
    
    foreach($query->result as $row)
    {
    $id = $row['member_id'];
    
    $data = array('member_id' => $id);
    
    $sql1 = $DB->insert_string('exp_member_data', $data);
    $sql2 = $DB->insert_string('exp_member_homepage', $data);
    
    echo $sql1;
    echo '
    ';
    echo $sql2;
    echo '
    ';
    
    //$DB->query($sql1);
    //$DB->query($sql2);
    $i++;
    }
    echo 'done: '.$i;
    ?>

    I ran it fine.  But be sure to backup, because there are no guarantees.  Once you run it and the queries look fine to you- I’d comment out the echo and uncomment out the actual query.  So- THIS will make actual changes to the db:

    <?php
    global $DB;
    $i=0;
    
    $query = $DB->query("SELECT member_id FROM exp_members");
    
    foreach($query->result as $row)
    {
    $id = $row['member_id'];
    
    $data = array('member_id' => $id);
    
    $sql1 = $DB->insert_string('exp_member_data', $data);
    $sql2 = $DB->insert_string('exp_member_homepage', $data);
    
    
    $DB->query($sql1);
    $DB->query($sql2);
    $i++;
    }
    echo 'done: '.$i;
    ?>

    Just sticks an entry id in both of those tables.  From a quick look at the backend, that’s all you need.  But like I say- not guaranteed.

  • #14 / Apr 29, 2008 3:13pm

    Nelson @ Evoflux

    32 posts

    Two quick questions from a php beginner such as myself. First are you running this as a php file or the database query form? Second, where did you stick in the member id number? Line 3?

  • #15 / Apr 29, 2008 4:26pm

    Robin Sowell

    13255 posts

    Ah- sorry.  Basically- create a new template, turn php parsing ‘on’ for that template.  Can parse input or output- doesn’t matter.  Stick the above code in the template.  Do the first ‘test’ version first because can’t really screw anything up with it.  It just does the select- then prints out each insert that it will run once you remove the comments (\\) that I have before the actual inserts.

    What the php example does- first a query to get all of the current member ids:
    SELECT member_id FROM exp_members

    Then it loops through the results and does an insert into exp_member_homepage and exp_member_data for each id.  That’s what’s going on in the foreach loop- the $id is the member id- just loops through each one it found in that initial select.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases