Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End CMS + comments

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26139
    Makeshift
    Member

    Okay, so, this isnt exactly a comment issue, but what I’m trying to do is the same as doing somments..

    I needed to make 2 sections on my site for my news/updates and comments, so I found the post
    PHP for Beginners: Building Your First Simple CMS
    and decided to give it a shot.

    I got my comment section down no problem, but my updates wont seem to shoot.
    I’ve changed the names of the variables and matched them up (or so I thought,) but it’s still not doing the updates..

    I went into the database, and it’s not even making the table in the database, so I even tried making the table by hand, and that still didn’t work, if someone could help, I would be grateful..

    btw, the link to my site is.. Makeshift Designs

    Code:
    0){
    while($a = mysql_fetch_assoc($r)){
    $update = stripslashes($a[‘update’]);
    $time = stripslashes($a[‘time’]);

    $update_display .= <<$time

    $update


    n
    update_display;
    }
    }else{
    $update_display = <<Update

    Time: $time
    Update:

    ADMIN_FORM;
    }

    public function write($p){
    if ($_POST[‘update’])
    $update = mysql_real_escape_string($_POST[‘update’]);
    if ($_POST[‘time’])
    $time = mysql_real_escape_string($_POST[‘time’]);
    if ($_POST){
    $created = time();
    $ip = $_SERVER[‘REMOTE_ADDR’];
    $sqll = “INSERT INTO upDate VALUES(‘$update’,’$time’,’$created’,’$ip’)”;
    return mysql_query($sqll);
    }else{
    return false;
    }
    }

    public function Connect() {
    mysql_connect($this->host,$this->username,$this->password) or die(“Could not connect. ” . mysql_error());
    mysql_select_db($this->table) or die(“Could not select database. ” . mysql_error());

    return $this->BuildDB();
    }

    private function BuildDB() {
    $sqll = <<

    #64295
    cybershot
    Participant

    well i don’t know how to fix your issue. but I do have some advice. Do not quote serial killers on your website. Especially if you are trying to attract customers

    #64327
    jasonatennui
    Member

    The code snippet you’ve posted doesn’t look like it ever calls the Connect() method or the BuildDB() method. Try turning error reporting on:

    Code:
    error_reporting(E_ALL);
    ini_set(“display_errors”, “2”);

    See if you get any errors about the script not being able to connect to the database.

    #64335
    Makeshift
    Member

    actually, it has both.. I put in the error script, and it came up with an error of the connection resetting by peer, then after that, no errors. I tried it about 5 times.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.