The Barbados Yachting Association
Database Add: Results
/* input is $id, $name $cya */
$id = strtoupper($id);
$name = strtoupper($name);
$chars = strlen ($id);
$database="boats"; $table="yachts";
$calling_url = "http://localhost/~rhill/yachts/add.phtml";
$start_url = "http://localhost/~rhill/yachts/index.phtml";
if ($calling_url);
>
Return to database input form
Return to database home page
endif;
echo "
\n";
SetType($query, "string"); /* force string for overloaded ops */
$query = "id=" + "'"+ $id + "'";
/* Check for existence */
$result = mysql($database,"delete from $table where $query");
mysql_FreeResult($result);
$perf=0.0;
$result = mysql($database,"insert into $table values ('$id','$name',$cya,$perf)");
if ( $result == 0 );
echo "Successfully added $name with identifier $id and CYA of $cya
";
mysql_FreeResult($result);
else;
echo "Add failed
";
endif;
>