Jump to content


Photo

query help


  • Please log in to reply
1 reply to this topic

#1 aseaofflames

aseaofflames
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts
  • LocationUS

Posted 26 June 2006 - 03:59 PM

im having problems geting my script to insert values into my database

function addtosql($date, $ip, $name, $comments) {
if($name=="") $name = "Anonymous";
include('connect.php');
$check = str_replace('[video]','',$comments);
if($check!==$comments) {
$video = explode('[video]', $comments);
$videos = explode('[/video]', $video[0]);
$videourl = $videos[0]; 
$url = createasx($videourl);
if(file_exists($videourl)) {
$comments = $video[0]."[video]".$url."[/video]".$videos[1];
$comments = nl2br($comments);
$sql = "INSERT INTO guestbook VALUES ('', '$date', '$ip', '$name', '$comments')";
$result = mysql_query($sql);
}
}
elseif($check==$comments) {
$comments = nl2br($comments);
$sql = "INSERT INTO guestbook VALUES ('', '$date', '$ip', '$name', '$comments')";
$result = mysql_query($sql);
    }
elseif(!file_exists($videourl)) {
echo "Video Does Not Exist";
} 
}

if (isset($comment) && $comment!=="") {
$date = date("m-d-Y");
$name = $_POST['name'];
$ip = $_SERVER['REMOTE_ADDR'];
$comments = $_POST['comment'];
if(censor('$comments')=="explict") { echo "<div align='center'><font size='-1'><b>This Comment Contains Language Not Suitable For This Site!</b></font></div>"; }
else { 
addtosql('$date', '$ip', '$name', '$comments');
echo "<div align='center'>Comment Added. <a href='index.php'>Click Here</a></div><br>";
}
}
any help is greatly appricated

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 26 June 2006 - 05:44 PM

You'll need to echo the queries after the variable interpolation steps and post the output here so we can see what's wrong; also, where's your column list?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users