This query doesn't work. What have I dont wrong?

mysql_query("INSERT INTO list (title, url, description) 
VALUES ('$title', '$addtolist', '$description') 
DELETE FROM spider WHERE url='$addtolist'");

Heres the whole page if it makes things clearer.

<?php
include('includes/config.php');

$addtolist = $_GET['add'];

$open = file_get_contents($addtolist);

$title = get_inner_string($open, '<title>', '</title>');

$description = get_inner_string($open, '<meta name="description" content="', '" />');

mysql_query("INSERT INTO list (title, url, description) 
VALUES ('$title', '$addtolist', '$description') 
DELETE FROM spider WHERE url='$addtolist'");

header('Location: moderation.php');
?>

Recommended Answers

All 2 Replies

Try

mysql_query("INSERT INTO `list` (`title`, `url`, `description`) VALUES ('$title', '$addtolist', '$description')");
mysql_query("DELETE FROM `spider` WHERE url='$addtolist'");
commented: thanks +2

Ah that works :p

I do no where near enough work with MySQL. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.