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
Edit Calendar Event
Moderator: General Moderators
- Saethyr
- Forum Contributor
- Posts: 182
- Joined: Thu Sep 25, 2003 9:21 am
- Location: Wichita, Kansas USA
- Contact:
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.
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
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
-
ThinkGeekness
- Forum Newbie
- Posts: 16
- Joined: Sat May 17, 2003 8:00 pm
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
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