|
|
|
|
![]() ![]() |
Mar 10 2007, 12:11 AM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 397 Joined: 9-June 06 From: Wisconsin Member No.: 24,924 |
theres a bug somewhere in this query and i can't seem to find it. does anyone else see it?
CODE $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)";
|
|
|
|
Mar 10 2007, 12:34 AM
Post
#2
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 165 Joined: 12-September 05 Member No.: 11,777 |
$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? This post has been edited by saga: Mar 10 2007, 12:37 AM |
|
|
|
Mar 11 2007, 06:45 PM
Post
#3
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 12 Joined: 8-March 07 From: Gtown, Wisconsin Member No.: 39,728 |
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).
CODE $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: CODE $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)";
This post has been edited by andybebad: Mar 11 2007, 06:46 PM |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 26th July 2008 - 03:42 PM |