ghostrider 0 Report post Posted March 10, 2007 theres a bug somewhere in this query and i can't seem to find it. does anyone else see it? $query = "insert into templates (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive Template','A sample archive template that only shows the name of the article with a link to the default article viewer.','<a href='viewarticle1.php?aid=[id]'>[articletitle]</a>',FALSE)"; Share this post Link to post Share on other sites
saga 0 Report post Posted March 10, 2007 (edited) $query = "insert into templates (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive Template','A sample archive template that only shows the name of the article with a link to the default article viewer.','<a href='viewarticle1.php?aid=[id]'>[articletitle]</a>',FALSE)"; the whole code is correct for PHP but datebase will have problem parsing your query becuase of the single quotes used in the 2nd to the last value. and by the way should there be a dollar sign in id and article? like $id, $article? Edited March 10, 2007 by saga (see edit history) Share this post Link to post Share on other sites
andybebad 0 Report post Posted March 11, 2007 (edited) each element that is add to your table is separated by a aposthrophy, so you can't have them in your link unless you add an escape character (which in php is \ ) before the apostrophy in the link (as Saga said). $query = "insert into templates (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive Template','A sample archive template that only shows the name of the article with a link to the default article viewer.','<a href=\'viewarticle1.php?aid=[id]\'>[articletitle]</a>',FALSE)"; This code replaces [id] and [articletitle] with $id and $title: $query = "insert into templates (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive Template','A sample archive template that only shows the name of the article with a link to the default article viewer.','<a href=\'viewarticle1.php?id=". $id . "\'>".$title."</a>',FALSE)"; Edited March 11, 2007 by andybebad (see edit history) Share this post Link to post Share on other sites