Hi there,
when I was trying to update my database table, it gives a warning of
Warning: sprintf() [function.sprintf]: Too few arguments in C:\wamp\www\XXX\YYY.php on line 300
I wonder why.
this is the update button form code:
<form action="<?php echo $editFormAction; ?>" id="frmeditlect" name="frmeditlect" method="post">
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="left"><strong style="color:#FFF"> Status:</strong><strong id="sprytextfield50">
<label>
<input style="color: #009; font-family: Verdana, Geneva, sans-serif;
font-size: 11px;" name="lect_status" type="text" id="lect_status" value="<?php echo $row_editlecturer['lect_status']; ?>" size="40" maxlength="100" />
</label></strong>
</td></tr>
<tr>
<td height="25" colspan="3" align="left"> <label>
<input type="image" src="image/button_update1.gif" name="" vvalue="Save" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="frmeditlect" />
</form>
this is the function code:
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frmeditlect")) {
$updateSQL = sprintf("UPDATE lecturer SET lect_status=%s WHERE lect_id=%s",
GetSQLValueString($_POST['lect_status'], "text"));
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($updateSQL, $connection) or die(mysql_error());
}
I want to update ‘only’ one column in my database table. But it’s stated my argument too few. how to solved that?