I am trying to pull a url from one table and then have it placed in another to have words extracted from it. My code looks good but I keep getting an error message at line 40.
The error message states
While executing query "INSERT INTO pid_ct_pages (page_url) VALUES (page_url = http://dir.yahoo.com/rss/dir/getrss.php?biz)" the following error occured: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '://dir.yahoo.com/rss/dir/getrss.php?biz)' at line 1 In: /home/rtiper/public_html/xxxx/RSS_Key_Words/index.php on line: 40
Here is the code below.
$result = $db->sql_query("SELECT lid, cid, title, url FROM ".$prefix."_rss_rss ORDER BY cid DESC LIMIT 0,30" ,false,__FILE__,__LINE__);
while (list($lid, $cid, $title, $url,) = $db->sql_fetchrow($result)) {
$title = stripslashes($title);
echo '<a href="'.getlink('RSS&l_op=Showrss&cid='.$cid).'">'.$title.'</a><br>';
echo "$title<br />";
echo "$url<br /><br />";
$url = $row['url'];
/* Does this URL already have a record in the page-table? */
$result2 = $db->sql_query("SELECT url FROM ".$prefix."_rss_rss");
$row = $db->sql_fetchrow($result2);
if( $row['lid'] )
{
/* If yes, use the old page_id: */
$lid = $row['lid'];
}
else
{
/* If not, create one: */
line 40----> $db->sql_query("INSERT INTO ".$prefix."_ct_pages (page_url) VALUES (page_url = ".$row['url'].")");
$page_id = mysql_insert_id();
}
I don't see where I am going wrong.