943,895 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 577
  • PHP RSS
Feb 21st, 2009
0

MySQL Query Problem

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

php Syntax (Toggle Plain Text)
  1. mysql_query("INSERT INTO list (title, url, description)
  2. VALUES ('$title', '$addtolist', '$description')
  3. DELETE FROM spider WHERE url='$addtolist'");

Heres the whole page if it makes things clearer.

php Syntax (Toggle Plain Text)
  1. <?php
  2. include('includes/config.php');
  3.  
  4. $addtolist = $_GET['add'];
  5.  
  6. $open = file_get_contents($addtolist);
  7.  
  8. $title = get_inner_string($open, '<title>', '</title>');
  9.  
  10. $description = get_inner_string($open, '<meta name="description" content="', '" />');
  11.  
  12. mysql_query("INSERT INTO list (title, url, description)
  13. VALUES ('$title', '$addtolist', '$description')
  14. DELETE FROM spider WHERE url='$addtolist'");
  15.  
  16. header('Location: moderation.php');
  17. ?>
Similar Threads
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007
Feb 21st, 2009
1

Re: MySQL Query Problem

Try
php Syntax (Toggle Plain Text)
  1. mysql_query("INSERT INTO `list` (`title`, `url`, `description`) VALUES ('$title', '$addtolist', '$description')");
  2. mysql_query("DELETE FROM `spider` WHERE url='$addtolist'");
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Feb 21st, 2009
0

Re: MySQL Query Problem

Ah that works :p

I do no where near enough work with MySQL. Thanks.
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: fitting image in image placeholder!help
Next Thread in PHP Forum Timeline: phploginform





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC