For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > October 2005 > MySQL, Checkboxes and DWMX









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MySQL, Checkboxes and DWMX
omniogroup@yahoo.com

2005-10-07, 6:58 pm

Setting:

One Database, One Table

CREATE TABLE `rss` (
`rssID` int(11) NOT NULL auto_increment,
`Name` varchar(100) default NULL,
`URL` varchar(255) default NULL,
`Cat` varchar(100) default NULL,
`ts` timestamp(14) NOT NULL,
`Com` blob,
`spName` varchar(100) default '',
`spURL` varchar(255) default '',
`sp` varchar(5) default '',
PRIMARY KEY (`rssID`)
) TYPE=MyISAM;

I have text boxes (which insert into Name, URL ) on my webpage. When a
user clicks a checkbox however, I want this same data inserted into
spName, spURL. That's it!

How can I do this using the traditional Insert code that Dreamweaver
generates?


$insertSQL = sprintf("INSERT INTO rss (Name, URL, Cat, Com, sp)
VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Name'], "text"),
GetSQLValueString($_POST['Url'], "text"),
GetSQLValueString($_POST['Cat'], "text"),
GetSQLValueString($_POST['com'], "text"),

Do I do a if condition??

Any help would be great!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com