thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Login #31

Open 3c75 opened 10 years ago

3c75 commented 10 years ago

I skipped the nav section, kept the links that are generated hard coded. Then needed slugs, so went back to make nav dynamic. Realised I didnt make 'label' column, made it. Sorted the code. Ran it to see this ugly thing: Fatal error: Cannot redeclare data_page() in admin\functions\data.php :(

Here is that particular code:

<?php

function data_page($dbc, $id){

    $q = "SELECT * FROM pages WHERE id = '$id'";
    $r = mysqli_query($dbc, $q);

    $data = mysqli_fetch_assoc($r);

    return $data;   }

    function data_user($dbc, $id){

        $q="SELECT * FROM users WHERE email ='$id'";
    $r = mysqli_query($dbc, $q);

    $data = mysqli_fetch_assoc($r);

    return $data;
    }

    ?>
thedigicraft commented 10 years ago

Yeah you cannot have this:


function data_page($dbc, $id){

$q = "SELECT * FROM pages WHERE id = '$id'";
$r = mysqli_query($dbc, $q);

$data = mysqli_fetch_assoc($r);

return $data;   
}

Twice anywhere in your code. So make sure you don't. Look at all files that are included() and make sure you dont have that chunk of code anywhere else.