austine_power007 Posted December 17, 2006 Share Posted December 17, 2006 I have a page named update_data.php the code:[code]echo" <table width='548' height='255' border='0'> <form name='exampleform' onsubmit='return formValidator()' method='POST' action='update_success.php'> <tr> <td width='159' align='right' valign='middle' class='style12'>Job Title:</td> <td colspan='3'><input name='job_ttl' type='text' id='job_ttl'value=\"{$titl}\" size='50' DISABLED></td> </tr> <tr> <td align='right' valign='middle' class='style12'>Start Date: </td> <td colspan='2'><label> <input name='start_dat' type='text' id='start_dat' value=\"{$start}\" DISABLED> </label></td> <td width='227'> </td> </tr> <tr> <td align='right' valign='middle' class='style12'>Est. End Date: </td> <td colspan='2'><label> <input name='est_dat' type='text' id='est_dat' value=\"{$end}\" DISABLED> </label></td> <td> </td> </tr> <tr> <td align='right' valign='middle' class='style12'>Actual End Date: </td> [b]<td colspan='2'><label> <input type=\"text\" name=\"act_dat\" value=\"{$actual[0]}$actual[1]\" size='01'><span class='style12'>dd</span><input type=\"text\" name=\"act_mon\" value=\"{$actual[3]}$actual[4]\" size='01'><span class='style12'>mm</span><input type=\"text\" name=\"act_yr\" value=\"{$actual[6]}$actual[7]\" size='01'><span class='style12'>yy</span> </label></td>[/b] <td> </td> </tr> <tr> [b]<td height='39' align='right' valign='middle' class='style12'>Completed:</td> <td colspan='3' bordercolor='#000000'><table width='300' border='0'> <tr> <td width='20'><input name='comp' type='text' id='comp' value=\"{$complete}\" size='01' ></td>[/b] <td width='270'><span class='style15'><span class='style17'><span class='style19'>%</span> <strong>( Integer</strong></span><span class='style22'> numbers Only)</span></span></td> </tr> </table></td> </tr> <tr> [b]<td height='46' align='right' valign='top' class='style12'>Remarks:</td> <td colspan='3' valign='top'><textarea name='remark' cols='50' id='remark'>{$remark}</textarea></td>[/b] </tr> <tr> <td height='26' align='right' valign='middle' class='style10'> </td> <td width='66'><label> <input type='submit' name='Submit' value='Submit'> </label></td> <td width='78'><input type='reset' name='Submit2' value='Reset'></td> <td><label></label></td> </tr> </form> </table> "; }[/code]Ok in this code i retrive some data from database Now i when user click submit it goes to update_success.php page and the code of update is:[code]<?phpinclude "connect_db.php";if (isset($_GET['Submit'])) // name of submit button{$title=$_GET['job_ttl'];echo "$title";$act_date=$act_mon.'/'.$act_dat.'/'.$act_yr;$complete=$_GET['comp'];$remark=$_GET['remark'];$query = odbc_exec($odbc, "UPDATE task act_end_date ='$act_date',complete = $complete,remark = '$remark' WHERE title = '$title'") or die ("Wrong data");function Redirect($time, $topage) { echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$topage}\" /> ";}Redirect(1, "profile.php");exit;}?>[/code]But it update nothing ....wht is happneing ?? help me with my college project :( [b]E.G: i am using Microsoft Access 2003[/b] Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted December 18, 2006 Author Share Posted December 18, 2006 anyone out there to help me??? :( Quote Link to comment Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Your missing the SET keyword in your query.[code=php:0]query = odbc_exec($odbc, "UPDATE task SET act_end_date ='$act_date',complete = $complete,remark = '$remark' WHERE title = '$title'") or die ("Wrong data");[/code] Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted December 18, 2006 Author Share Posted December 18, 2006 [quote author=thorpe link=topic=118958.msg487046#msg487046 date=1166412724]Your missing the SET keyword in your query.[code=php:0]query = odbc_exec($odbc, "UPDATE task SET act_end_date ='$act_date',complete = $complete,remark = '$remark' WHERE title = '$title'") or die ("Wrong data");[/code][/quote]I have tried with the SET also but it didn't update the table why?? is it getting data from other files?? Quote Link to comment Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Your form sends via post yet your trying to retrieve the data via $_GET, use $_POST instead. Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted December 18, 2006 Author Share Posted December 18, 2006 I have tryed with POST now it can't get those variable value error is:Notice: Undefined index: job_ttl in c:\inetpub\wwwroot\flash\update_success.php on line 82 got so many same kind of error ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.