Page 1 of 1
Edit Calendar Event
Posted: Fri Jan 02, 2004 2:08 pm
by ThinkGeekness
have built a calendar based on php/MySQL. I am now designing the admin interface. I have already created the add event form, now I am stuck on the edit event form. I have a picture of what the form I want to look like at
http://thinkgeekness.com/images/cap.jpg. Anyways, I want you to first select the date of the event that you want to edit. Then after the date has been selected, I want it to pull all of the events from the database with that date into a drop down menu. From the drop down menu you would then select the event that you want to edit, and then have it appear in the text field.
I am pretty much stuck on this, so any help would be greatly appreciated.
Thanks, Justin
Posted: Fri Jan 02, 2004 3:09 pm
by Saethyr
Do a check at the top of the page for your submit variable and the do the following, note: doing in psuedo because im a lazy beotch.
Code: Select all
<?php
function doSelect()
if ($_REQUEST["submit"])
//Connection Stuff
$sql = "SELECT events FROM datetable WHERE month = '$month' AND day = '$day' and year = '$year' ORDER BY id";
$result = mysql_query($sql);
echo "<select name=name>";
while ($row = mysql_fetch_array($result) {
<option>$row["events"];
}
echo "</select>"
}
else{
echo "<select name=name><option></option></select>";
}
}
?>
or something along those lines. Now don't critique the code as I wrote it in 3 minutes. This should give you atleast one idea.
Saethyr
Posted: Fri Jan 02, 2004 7:11 pm
by ThinkGeekness
That gave me an idea, but it also brought another one. I coded a modified version of that, but I am getting an error. PHP is server side, how could it see what the date is and pull the list of the events without a refresh? You would then need to incorporate Javascript into it, which I do not know besides the very basic stuff.
So if anybody could either point me to a tutorial that would help with what I want to do or if you could post the actual code, it would help a ton.
Thanks