Changing data
Posted: Mon Apr 29, 2002 3:11 am
I have I script that when the user inputs a number it will go away and change another rows data, e.g. you enter 1234 and in the other row will change from 'no' to 'yes'. The problem is that the script i have made will let you input anything, even a empty filled it will come back with 'DONE' and not my error message saying that the number entered is not in the DB.
Where is the script i have been using :
$username = "USERNAME";
$password = "PASSWORD";
$database = "DATABASENAME";
$db = mysql_connect("localhost", "$username", "$password");
mysql_select_db("$database",$db);
$result = mysql_query("SELECT * from inputform",$db);
$QUERY01 = "update inputform set invoice='yes' where jobid='$button'";
while ($row = mysql_fetch_array($result)) $in_db[] = $row["jodid"];
if (in_array($button, $in_db)) {
if (mysql_db_query ($database, $QUERY01, $db)) {
print ("<BR><BR>Q1 DONE<BR><BR>");
}
} else { print ("Job Number Not In Database"); }
-----END OF SCRIPT----------
Where is the script i have been using :
$username = "USERNAME";
$password = "PASSWORD";
$database = "DATABASENAME";
$db = mysql_connect("localhost", "$username", "$password");
mysql_select_db("$database",$db);
$result = mysql_query("SELECT * from inputform",$db);
$QUERY01 = "update inputform set invoice='yes' where jobid='$button'";
while ($row = mysql_fetch_array($result)) $in_db[] = $row["jodid"];
if (in_array($button, $in_db)) {
if (mysql_db_query ($database, $QUERY01, $db)) {
print ("<BR><BR>Q1 DONE<BR><BR>");
}
} else { print ("Job Number Not In Database"); }
-----END OF SCRIPT----------