- This topic is empty.
-
AuthorPosts
-
September 16, 2009 at 5:25 pm #26139
Makeshift
MemberOkay, 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 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 = <<September 17, 2009 at 1:19 pm #64295cybershot
Participantwell 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
September 17, 2009 at 7:35 pm #64327jasonatennui
MemberThe 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.
September 17, 2009 at 9:06 pm #64335Makeshift
Memberactually, 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.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.