Hi, I’m trying to create a simple blog where I can post entries to a database. I’m having trouble with attaching multiple categories to a single post. There’s an image of my database here… http://david.flexlab.co.uk/wp-content/images/tables.jpg
I so far have a stored procedure to handle the post update
CREATE Procedure apPostAdd
@AuthorID int,
@PostTitle varchar(255),
@PostBody text,
@PublicationDate datetime
As
BEGIN TRANSACTION
INSERT tblPosts (AuthorID, PostTitle, PostBody, PublicationDate)
VALUES (@AuthorID, @PostTitle, @PostBody, @PublicationDate)
GO
I’ve got a loop working to select all the rows in tblCategory into my post form.
<%
Set rstCat = GetAllCategory
DO WHILE NOT rstCat.EOF
%>
<tr>
<td><label for="<%=rstCat("CategoryTitle")%>"><%=rstCat("CategoryTitle")%></label></td>
<td><input name="<%=rstCat("CategoryTitle")%>" id="<%=rstCat("CategoryTitle")%>" type="checkbox" value="<%=rstCat("CategoryID")%>" /></td>
</tr>
<%
rstCat.MoveNext
LOOP
rstCat.Close
%>
I’m just not sure how to go about updating the tblPostCategory in the same form. If anyone has any suggestions or tutorials on how this is done it would be a great help.
David