MySQL Query Problem

Thread Solved

Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

MySQL Query Problem

 
0
  #1
Feb 21st, 2009
This query doesn't work. What have I dont wrong?

  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.

  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. ?>
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 525
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: MySQL Query Problem

 
1
  #2
Feb 21st, 2009
Try
  1. mysql_query("INSERT INTO `list` (`title`, `url`, `description`) VALUES ('$title', '$addtolist', '$description')");
  2. mysql_query("DELETE FROM `spider` WHERE url='$addtolist'");
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

Re: MySQL Query Problem

 
0
  #3
Feb 21st, 2009
Ah that works :p

I do no where near enough work with MySQL. Thanks.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 426 | Replies: 2
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC