Jump to content

Archived

This topic is now archived and is closed to further replies.

aseaofflames

query help

Recommended Posts

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

[code]
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>";
}
}
[/code]
any help is greatly appricated

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.