Jump to content

JustLikeIcarus

Members
  • Posts

    430
  • Joined

  • Last visited

Everything posted by JustLikeIcarus

  1. I believe the new_name arr should be returned as simply return $new_name; and not return $new_name[]; Also you may want to declare $new_name in the main while loop because it appears that its scope is that of the inner if statement.
  2. you could name your radios as "action[$sqlresult->id]" with values of "delete" and "approve" then just do. $actions = $_POST['action']; foreach($actions as $id => $action){ if($action == 'delete') //etc ... }
  3. Try this SELECT issues.*, priorities.priority_code FROM issues, priorities, assignments WHERE issues.issue_priority_id = priorities.priority_id AND issues.issue_id = assignments.assignment_issue_id AND assignments.assignment_user_id = 1 AND issues.issue_closed_by IS NULL
  4. Its actully done with div's its commonly known as the coda slider effect, made popular by panic who makes a web dev app called coda. take a look at http://jqueryfordesigners.com/coda-slider-effect/
  5. The Javascipt is inserting the text into pre-defined elements on the page. You would need their parent element which is most likely what is styled as a grey box. Try using firebug and inspecting the document when the message is showing. That should tell you what it is that needs to be styled.
  6. Yeah the issue is that your current query is pulling all records from tb1 as the very first thing it does. It doesn't know whats in the other tables therefor it has to pull back everything and then examine them for matches. If you want to make use of indexes you will need to add another AND specifying a certain key/value pair like tb1.column = 'apple' or whatever. I may be able to provide more help if you let me know what the data is and what your trying to return from the query.
  7. Why not just do function addExt(){ var toRemExt = new Array(); //Create array to hold items to remove elm = document.getElementById('ext'); for(e = 0; e < elm.length; e++){ //loop all the select box items if(elm.options[e].selected){ //work with only the selected items addOption(document.frmExt.curExt, elm.options[e].value, elm.options[e].value); //Add option approved side removeOption(document.frmExt.ext,e); //remove item from select box } } } [code]
  8. Yeah since nothing in there were clause is limiting the initial results from tb1 then your going to do a full table scan. Only way to not do one would be to specify tb1.col = value for an indexed column.
  9. My advice would be using jQuery/jQuerUI to do this.. jQuery can do all that you are wanting and is relatively simple to implement. Take a look at the jquery ui dialog function for what your wanting specifically.
  10. From http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/ function insertAtCaret(areaId,text) { var txtarea = document.getElementById(areaId); var scrollPos = txtarea.scrollTop; var strPos = 0; var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false ) ); if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); strPos = range.text.length; } else if (br == "ff") strPos = txtarea.selectionStart; var front = (txtarea.value).substring(0,strPos); var back = (txtarea.value).substring(strPos,txtarea.value.length); txtarea.value=front+text+back; strPos = strPos + text.length; if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); range.moveStart ('character', strPos); range.moveEnd ('character', 0); range.select(); } else if (br == "ff") { txtarea.selectionStart = strPos; txtarea.selectionEnd = strPos; txtarea.focus(); } txtarea.scrollTop = scrollPos; } Usage: <textarea id="textareaid"></textarea> <a href="#" onclick="insertAtCaret('textareaid','text to insert');return false;">
  11. replace your opening "<html>" tag with: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> Should take care of it. I tested it and it appeared fine.
  12. Try this css body{ margin:0px;} .checklist_data_container{ width: 100%; background-color: #ddd; } .checklist_data_heading{ width: 100% height: 30px; background-color: blue; } .checklist_data_text{ width: 80%; height: 60px; background-color: green; display:block; } .checklist_data_options_container{ margin-left:80%; margin-top:-60px; width: 20%; height: 60px; background-color: yellow; } .checklist_data_options_text{ position: relative; height: 20px; text-align: left; background-color: grey; } .checklist_data_options_input{ position: relative; height: 20px; top: -60px; left: 50%; width: 50%; background-color: purple; } .checklist_data_input_options{ text-align: left; background-color: pink; }
  13. Your different font size in .leftmenusmall is throwing off the padding of the element. Gotta love i.e.
  14. The way i do it is just give the file inputs the name of img[]. Then $_FILES['img'] itself will be an array of the files.
  15. "show" is a mysql reserved word. you will need to put backticks around it. I would recommend renaming the column
  16. Ummm.. Have you tried..? select supplier_id, price, max(timestamp) from prices where product_id = ? group by supplier_id, price
  17. Im guessing the slowdown you saw is related to how UNION used its temporary table. Even though you did UNION ALL it still has to throw everything into a temporary table. Plus with the unions you went back to "tb1" several time. Where as using a join with the OR's your only going to hit the first table once. The other tables youll hit more though. Thy this im curious on its performance, SELECT tb1.*, tb2.*, tb3.* tb4.* FROM tb1, tb2, tb3, tb4 WHERE tb1.col = tb2.col AND tb2.col = tb3.col AND tb3.col = tb4.col AND ( tb1.col1 = value OR tb1.col2 = value OR tb1.col3 = value ) ORDER BY tb1.col4
  18. xampp http://www.apachefriends.org/en/xampp-windows.html (which i prefer over wamp) comes with mercury mail server. I've used it to send emails from a dev environment with no issues.
  19. Check the post I just added to another thread http://www.phpfreaks.com/forums/index.php/topic,276686.msg1308826.html#msg1308826 I believe its what you want.
  20. Something like this? Just a note i changes all of the tables to plural names to make more sense to me. Try this see what you get without having data to play with i cant be sure. I also didnt use the normal "JOIN" syntax. select papers.pname, authors.aname from papers, authors, co_authors where papers.pid = co_authors.pid and co_authors.aid = authors.aid and papers.pid in (select pid from co_authors where aid = 457)
  21. Personally I would change the root category parent ids to 0 then generate the entire tree at once with something like. Or if you seperate by page you would just need to send the "parent" id to this same type of function via a get variable. Do a search on Adjacency List Model their are tons of example out there. function display($parent) { $result = mysql_query('SELECT category_id, name FROM categories WHERE parent ='. $parent); $html = '<ul>'; while ($row = mysql_fetch_array($result)) { $html .= '<li><a href="whatever.php?cat='.$row['category_id'].'" >'.$row['name'].'</a></li>'; display($row['id']); } $html .= '</ul>'; return $html; } $tree = display(0); echo $tree;
  22. Here is how i did it in the past. The disableDays function you see being called basically looks at the current date to see if its available. The reportForm2.html is backend script that returns a JSON object of all available days. $.getJSON("reportForm2.html", {id: itemId}, function(data, textStatus) { global = data; $('#fromDate, #toDate').datepicker({ dateFormat: 'mm/dd/yy', showOn: "button", buttonImage: "images/icons/calendar.png", buttonImageOnly: true, changeYear: true, changeMonth: true, duration:0, showButtonPanel: true , beforeShowDay: disableDays }); });
  23. If you put $var inside of single quites like '$var' then that literally mean '$var' it doesnt interpolate $var. One way you could do this would be: foreach ($test as $key => $value) { $key = 'course_date'.$key; $insert_values .= "(\'".$_POST[$key]."\', \'$id\'), "; } That should work but you should probably look into using bind variables where appropriate.
  24. Sounds like it doesnt have rights to modify the file. I would start by looking at that.
  25. Give the checkboxes names of approve[] and delete[] then set their values equal to the id. Like: <input type="checkbox" name="approve[]" value="1" /> Then if its checked you will have an approve array. $approved = $_POST['approve']; foreach($approved as $id){ //do whatever }
×
×
  • 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.