Forum Moderators: coopster

Message Too Old, No Replies

Problem with PHO calendar not updating

PHP calendar

         

galahad2

8:32 am on Jul 20, 2009 (gmt 0)

10+ Year Member



Hi, have a strange issue with a custom PHP calendar not updating the date of an event, although other fields are updated without any problems. because of this, users cannot change the day / date the event appears on in the calendar after they've posted the event. Any ideas?

The code in my event_edit.php is as follows:

<?php

$event=mysql_fetch_assoc(mysql_query("SELECT id,project,site,name,description,DATE_FORMAT(date,'%d/%m/%Y') AS date,days FROM events WHERE id=".$_REQUEST['e']));

$sites=mysql_query("SELECT id,CONCAT(name,' (',number,')') AS name FROM sites WHERE project=".$event['project']." ORDER BY name");

?> <div id="Content-Header">Edit Event - <?php echo $event['name']; ?></div>
<div id="Content-Body">

<link rel="stylesheet" href="/inc/css/light.datepicker.css" type="text/css" media="screen">
<script src="/inc/js/jquery-latest.js"></script>
<script src="/inc/js/jquery.datePicker.js"></script>
<script>
$(document).ready(function(){ $('#idDate').datepicker(); });
</script>

<form action="./" method="post" onsubmit="return chkFormSite();">
<table>
<tr><th><label for="idName">Event Title</label></th></tr><tr><td><input id="idName" name="name" type="text" value="<?php echo $event['name']; ?>" /></td></tr>
<tr><th><label for="idDate">Event Date</label></th></tr><tr><td><input id="idDate" name="date" type="text" value="<?php echo $event['date']; ?>" /></td></tr>
<tr><th><label for="idDays">Event Duration (days)</label></th></tr><tr><td><input id="idDays" name="days" type="text" value="<?php echo $event['days']; ?>" /></td></tr>
<tr><th><label for="idClient">Site Name</label></th></tr><tr><td><select id="idSite" name="site"><option value="0"></option><?php while($site=mysql_fetch_array($sites)) { echo "<option value=\"{$site['id']}\""; if(isset($event['site']) AND $event['site']==$site['id']) echo " selected=\"selected\""; echo ">{$site['name']}</option>"; } ?></select></td></tr>
<tr><th style="font-weight:normal;"><label for="idDesc">Description</label></th></tr><tr><td><textarea id="idDesc" name="desc" cols="5" rows="4"><?php echo $event['description']; ?></textarea></td></tr>
</table>
<input type="submit" name="update" value="Update Event" /> or <a href="../">Cancel</a> or <a href="../delete/" onclick="if(!confirm('Are you sure want to delete this event? There is no undo.')) return false;">Delete</a>

</form>

</div>

vincevincevince

4:58 am on Jul 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We do not see the INSERT or UPDATE line there, but I suspect you are not properly changing the DD/MM/YYYY format back into the format used within the table.

Try to echo your INSERT or UPDATE SQL command and see!