Jump to content

tsetsuit

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by tsetsuit

  1. Ok ajax got me closer to where I want to be but I end up right back at the same questions. when i click on the link to run the query how do I run a query against a field. so say you click on This link and the way that link was put there is off of a statement like $url = "whatever" $sql= mysql_query("SELECT link FROM table where name=$url"); while($row = mysql_fetch_array($sql)) { echo "so say you click on" . "<a href onclick=switch($id)>" . $row['link'] . "</a>" . "and the way"; } ok so say that code is real and that when i click on the link i want to run this query $sql = mysql_query("Select * from table where id="whatever the id is of that row"); <ajax to insert it on same page> I am still stuck where I don't know how to get the id of the row to displace it all on the page. Ajax showed me how to display it on same page that helped me get to next step after i figure this one out. I am guessing either i am being very dense about using $_get['id'] or i have been explaining myself wrong.
  2. Thank you BK87 for your help I will have to try this out when I get back to my server. Someone else also suggested using AJAX to me for this, which I know javascript so I may look into this as well.
  3. Only problem with that is that it will show all postings I have in order, I just want the one posting that corresponds with the item i am clicking on. Hmmm.... example time lets say you input 7 scheduled items into a database. now when you look at the calendar you see all the scheduled items in the calender under the date you scheduled them but only thing you see if the type of item you scheduled not any of the information. Now you want to be able to click on one of those scheduled items and find the information that directly relates to that schedule such as the subject, or who it will e-mail for notification. that is the problem i am having when i do this query $sql = mysql_query("SELECT * FROM Postings where rows=(look at note below)") I don't know how to get the row value from clicking on that. I understand how to post everything but i just want that one row that corresponds with the scheduled maintenance or meeting or other. I really hope that helps explain it better this thing is driving me nuts.
  4. include 'connection string' $sql="INSERT INTO `table_name` (`firstname`, `lastname`) VALUES('$_post['first_name']', '$_POST['last_name']')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } <p><strong>Your First Name:</strong><br /> <?echo "$_POST[first_name]"; ?> <p><strong>Your Last Name:</strong><br /> <?echo "$_POST[last_name]"; ?> <p><strong>Your EMail Address:</strong><br /> <?echo "$_POST[email]"; ?> <p><strong>Your Address:</strong><br /> <?echo "$_POST[address]"; ?> <p><strong>Your Contact No:</strong><br /> <?echo "$_POST[contact_no]"; ?> <p><strong>Cars:</strong><br /> <?echo "$_POST[units_car]"; ?> <p><strong>Pickups:</strong><br /> <?echo "$_POST[units_pickup]"; ?> <p><strong>Vans:</strong><br /> <?echo "$_POST[units_van]"; ?> <p><strong>Reservation Date:</strong><br /> <?echo "$_POST[month]"; ?><br /> <?echo "$_POST[day]"; ?><br /> <?echo "$_POST[year]"; ?><br /> <p><strong>Message:</strong><br /> <?echo "$_POST[inquiries]"; ?><br /></p> mysql_close($con); I would advise not just coping this into your page before you atleast read first two things posted below http://www.w3schools.com/php/php_mysql_intro.asp http://us3.php.net/mysql_real_escape_string two things you need to read before you put it on a page.
  5. I have it right now just showing the type and the rows in the date. So when i click on type i need it to show the month date year subject email post all the rest of the database in a box to the right of the whole calendar. I have everything figured out other then when i click how do i bind that link to the data in my database show it shows the data listed to right. This is difficult to explain sorry. I can post more code from the input page and more of the calendar page if needed. btw 'rows' in my mysql database is my primary auto_increment that's the value i need to find to run do something like $query = mysql_query("select * from postings where rows=(this is part i don't know how to do)" ); while($row = mysql_fetch_array($query)) { echo $row['type'] . "<br/>"; echo $row['subject'] . "<br/>"; echo $row['p0sting] . "<br/>"; } oops had to do an edit on that was way off on first example
  6. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.