4
another question, but not on dropping tables,
updating them this time....
i currently have this code:
<?php
//Meta Redirect
echo "<head>";
echo "<meta http-equiv='Refresh' content='5;url=index.php'>";
echo "</head>";
//Get XOOPS Stuff
include "../../../include/cp_header.php";
xoops_cp_header();
//Retrieve Data from Form
$cid = $_POST['cid'];
$pic = $_POST['pic'];
//Set MySQL Table
$table = $xoopsDB->prefix( "bf2stats" ) ;
//Update Table
if (isset($cid)) {
$xoopsDB->query("UPDATE `$table` SET `cid` = '$cid', `pic` = '$pic' WHERE `wid` = '1' LIMIT 1");
}
if (empty($cid)) {
$cid = "Value Empty!";
$emp = "1";
}
if (empty($pic)) {
$pic = "Value Empty!";
$emp = "1";
}
OpenTable();
?>
<p align="center">Battlefield 2 Stats Supplied By bf2tracker.com</p>
<p align="center">You will be redirected back to the main page in 5 seconds.<br>
<?php
echo "$pic" ;
echo "$cid" ;
?>
<br>
<?php
if ($emp === '1') { echo "<font color='red'>Database Was Not Updated because one or more
variables are missing.</font>"; }
if (empty($emp)) { echo "<font color='green'>Database Was successfully updated.</font>"; }
?>
</p>
<p align="center">
<div align="center">
<table border="0" width="50%" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><p align="right">BF2 Tracker Clan ID
<br>
</td>
<td>
<p align="center"><?php echo $cid ?></td>
</tr>
<tr>
<td width="50%">
<p align="right">Display Pictures on Side</td>
<td>
<p align="center">
<?php echo $pic ?>
</td></td>
</tr>
<tr>
<td width="50%"> </td>
<td> </td>
</tr>
</table>
<?php
CloseTable();
xoops_cp_footer();
?>
Now i know the data gets to it from the other form, and it all works, except it doesn't update the database.
Any Ideas?