Hey Guys
Im having some problem with my MYSQL, Here is the source code for my content
<?php
$db = new sql();
$id = $_GET['edit'];
$db->sql_query("SELECT * FROM `content` WHERE `id` = '$id'");
$mysql_array = $db->fetch_array();
?>
<form id="form2" name="form1" method="post" onsubmit="return submitForm();" action="?content&update=<?php echo $_GET['edit']; ?>">
<p> Page name<br />
<span id="sprytextfield2">
<input name="name" type="text" value="<?php echo $mysql_array['pagename']; ?>" id="name" size="85" />
<span class="textfieldRequiredMsg">A value is required.</span></span></p>
<p>Page content<br />
<script language="JavaScript" type="text/javascript">
//<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', '<?php echo rteSafe($mysql_array['content']); ?>', 760, 500, true, false);
//-->
</script>
<br />
<input type="submit" name="button2" id="button2" value="Submit" />
</p>
</form>
Here's the "IF" to see when to update the database.
if (isset($_GET['update']))
{
echo updateContent($_POST['name'], $_POST['rte1'], $_GET['update']);
echo "updating";
}
This is my update function
function updateContent($pgname, $content, $id)
{
$db = new sql();
$db->sql_query("UPDATE `content` SET `pagename` = '$pgname',
`content` = '$content' WHERE `id` = '$id'");
echo mysql_error();
}
Now when i submit the data, the database has no record of my data, i have uploaded my code to my webserver and it seems to do it there too..
Please help me i am SO ???ed
Thanks,
Richard