aseaofflames Posted June 26, 2006 Share Posted June 26, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/12942-query-help/ Share on other sites More sharing options...
fenway Posted June 26, 2006 Share Posted June 26, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/12942-query-help/#findComment-49742 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.