Ok having a bit of an issue with a calendar I am building. This is my first build using PHP so I am very new to it please let me know if I am messing anything up in process.
for the quick and simple, I am trying to have a link post a sql query in same page. In the calendar all you see if the type of request such as "meeting" , "maintenance" , or "other" the date you schedule it.
I have the input page to datebase working fine using a <form action='insert.php' method='post'> (code) </form>
Now the problem I am having is if i click on meeting, maintenance or other i want it to run a statement like
1.
2. ("select * from postings where id = (id of the posting)");
3.
now what I do not know how to do is get the id of the posting by clicking on that link to run query against it.
I have read through $_get statements to get the id but I am really still trying to figure that out completely for getting table ids. Plus I want to link this on same page so i don't think doing a
Line number On/Off | Expand/Contract
1.
2. $id = $_get('id') <a href='page.php?=$id>page</a>
3.
will work because that posts to a new page.
I have really been fighting this for last 2-3 days and tried to figure it out on my own before posting and had no luck.
posting some of the usefull code and datebase structure up below if anyone has any advice would be much appreciated. Thank you
SQL database info
changed some of the numbers and letters in database to prevent conflicts such as month=m0nth or date=da17
* id (auto_increment)
* m0nth
* da17
* year
* user_id
* type
* subject
* p0sting
* emails
This is what i use to populate the calendar with the scheduled dates, I know I still need to add mysql_real_escape_string into my select statements for security, still working on reading through how that works will input before I complete this.
1.
2. $txtmon = "'" . date("F", $date) . "'";
3. $now = getdate();
4.
[code]
[code=php]
1.
2.
3. if( $now['mday'] == $day && $now['month'] == date("F", $date) )
4. {
5. echo "<td class='test' align='top' valign='left'><a href='test2.html'>" . $day . "</a>";
6. echo "<table width=30px height=60px><tr><td class='inner' align='top' valign='left'>";
7. $posting = mysql_query("SELECT type,rows FROM postings WHERE da13=$day AND m0nth=$txtmon");
8. while($row = mysql_fetch_array($posting))
9. {
10. echo "<br />";
11. echo "<a href=''>" . $row['type'] . $row['rows'] . "</a>";
12. echo "<br />";
13. }
14. echo "</td></tr></table>";
15. echo "</td>";
16. } else {
17.
18. echo "<td class='dat' align='top' valign='left'><a href='test2.php'>" . $day . "</a>";
19. echo "<table width=30px height=60px><tr><td class='inner' align='top' valign='left'>";
20. $posting2 = mysql_query("SELECT type,rows FROM postings WHERE da13=$day AND m0nth=$txtmon");
21. while($row = mysql_fetch_array($posting2))
22. {
23. echo "<br />";
24. echo "<a href=''>" . $row['type'] . $row['rows'] . "</a>";
25. echo "<br />";
26. }
27. echo "</td></tr></table>";
28. echo "</td>";
29.
30. };
31. }
32.
33.
I want to post the SQL query in a jquery accordion to the right of the calendar. So when you click on the scheduled meeting or maintenance it pulls the information open to the right for the subject and who is getting e-mailed for it.The Jquery part i have taken care of I just need it to post on same page.
I have a cron job doing the e-mailing which is working fine.
Please any information would be much appreciated thank you