The column I'm updating from my table is called rej_acc.
I thought that if I entered the id of a row to be updated I could just update a NULL value with accepted.
However this script is crap!
Could someone give me some pointers where I should satrt again.
Code: Select all
<?php
<table width="200" cellpadding="0" cellspacing="0" border="0">
<tr align="center" valign="top">
<td align="left" colspan="1" rowspan="1" bgcolor="#FF69B4">
<form method="post" action="this.php">
id no.:
<br>
<INPUT TYPE='TEXT' NAME='id' VALUE='id' size=60>
<br>
<INPUT TYPE="submit" name="submit" value="submit">
</form>
</td></tr></table>
<?
$id=$_POST['id'];
$rej_acc=$_POST['rej_acc'];
$db="unitedartcity_co_uk_-_db";
$link = mysql_connect("localhost","","");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link) or die("Select Error: ".mysql_error());
$result=mysql_query("UPDATE tablename SET rej_acc='accepted' WHERE id='$id';
mysql_close($link);
print "updated\n";
?>
?>