•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,052 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,454 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 289 | Replies: 2
![]() |
•
•
Join Date: Jun 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I'm struggling to update my table with columns that are identified through variables. For example, I want to update Day3 using the hidden field "NewDay." Eventually, all of my days will be set using hidden field variable. Right now the trouble seems to be the statement %s=%s. Any suggests how to make the column defined by a variable. Thank you in advance. -Dave
I'm struggling to update my table with columns that are identified through variables. For example, I want to update Day3 using the hidden field "NewDay." Eventually, all of my days will be set using hidden field variable. Right now the trouble seems to be the statement %s=%s. Any suggests how to make the column defined by a variable. Thank you in advance. -Dave
$updateSQL = sprintf("UPDATE schedule SET Day1=%s, Day2=%s, %s=%s, Day4=%s, Day5=%s, Day6=%s, Day7=%s, Day8=%s, Day9=%s, Day10=%s, Day11=%s, Day12=%s, Day13=%s, Day14=%s, Day15=%s, Day16=%s, Day17=%s, Day18=%s, Day19=%s, Day20=%s, Day21=%s, Day22=%s, Day23=%s, Day24=%s, Day25=%s, Day26=%s, Day27=%s, Day28=%s, Day29=%s, Day30=%s, Day31=%s, Day32=%s, Day33=%s, Day34=%s, Day35=%s, Day36=%s, Day37=%s, Day38=%s, Day39=%s, Day40=%s, Day41=%s, Day42=%s WHERE UserID=%s",
GetSQLValueString($_POST['RadioGroup1'], "text"),
GetSQLValueString($_POST['RadioGroup2'], "text"),
GetSQLValueString($_POST['NewDay'], "text"),
GetSQLValueString($_POST['RadioGroup3'], "text"),
GetSQLValueString($_POST['RadioGroup4'], "text"),
GetSQLValueString($_POST['RadioGroup5'], "text"),
GetSQLValueString($_POST['RadioGroup6'], "text"),
GetSQLValueString($_POST['RadioGroup7'], "text"),
GetSQLValueString($_POST['RadioGroup8'], "text"),
GetSQLValueString($_POST['RadioGroup9'], "text"),
GetSQLValueString($_POST['RadioGroup10'], "text"),
GetSQLValueString($_POST['RadioGroup11'], "text"),
GetSQLValueString($_POST['RadioGroup12'], "text"),
GetSQLValueString($_POST['RadioGroup13'], "text"),
GetSQLValueString($_POST['RadioGroup14'], "text"),
GetSQLValueString($_POST['RadioGroup15'], "text"),
GetSQLValueString($_POST['RadioGroup16'], "text"),
GetSQLValueString($_POST['RadioGroup17'], "text"),
GetSQLValueString($_POST['RadioGroup18'], "text"),
GetSQLValueString($_POST['RadioGroup19'], "text"),
GetSQLValueString($_POST['RadioGroup20'], "text"),
GetSQLValueString($_POST['RadioGroup21'], "text"),
GetSQLValueString($_POST['RadioGroup22'], "text"),
GetSQLValueString($_POST['RadioGroup23'], "text"),
GetSQLValueString($_POST['RadioGroup24'], "text"),
GetSQLValueString($_POST['RadioGroup25'], "text"),
GetSQLValueString($_POST['RadioGroup26'], "text"),
GetSQLValueString($_POST['RadioGroup27'], "text"),
GetSQLValueString($_POST['RadioGroup28'], "text"),
GetSQLValueString($_POST['RadioGroup29'], "text"),
GetSQLValueString($_POST['RadioGroup30'], "text"),
GetSQLValueString($_POST['RadioGroup31'], "text"),
GetSQLValueString($_POST['RadioGroup32'], "text"),
GetSQLValueString($_POST['RadioGroup33'], "text"),
GetSQLValueString($_POST['RadioGroup34'], "text"),
GetSQLValueString($_POST['RadioGroup35'], "text"),
GetSQLValueString($_POST['RadioGroup36'], "text"),
GetSQLValueString($_POST['RadioGroup37'], "text"),
GetSQLValueString($_POST['RadioGroup38'], "text"),
GetSQLValueString($_POST['RadioGroup39'], "text"),
GetSQLValueString($_POST['RadioGroup40'], "text"),
GetSQLValueString($_POST['RadioGroup41'], "text"),
GetSQLValueString($_POST['RadioGroup42'], "text"),
GetSQLValueString($_POST['UserID'], "int"));
mysql_select_db($database_connJobvid, $connJobvid);
$Result1 = mysql_query($updateSQL, $connJobvid) or die(mysql_error()); Last edited by Tekmaven : Jul 19th, 2008 at 2:42 am. Reason: Code tags
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- cell value problem with double variable type (Java)
- XML Management (RSS, Web Services and SOAP)
- gridview update error (ASP.NET)
- Error from dbms_lob.writeappend (MS SQL)
- Please Help Me, I Am to Be Fired! (ASP.NET)
- Using MySQL with PHP - Tutorial by Herong (MySQL)
Other Threads in the PHP Forum
- Previous Thread: link protector help
- Next Thread: PHP uploading with a progress bar


Linear Mode