Jump to content

skyer2000

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

skyer2000's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm having a problem with jQuery for a "Mail Preview" box I'm developing. The real-time preview works the first time you use the dialog, but once you close and reopen it, the field is blank. Here is a demo: http://elementdesignllc.com/demos/temp/ Any ideas on how to allow this to work multiple times???
  2. Here is my table: key_table keyid papid userid 4 7 0 2 1 0 1 2 0 2 2 0 3 2 0 6 2 0 7 19 0 3 19 0 2 3 0 1 0 1 2 0 1 2 0 2 3 0 2 What I'm trying to figure out is how to setup a query that will check for a papid (lets say 2), get the keyid's associated to that papid (which would be 1,2,3,6), then pull all userid's that also have that keyid (which would output 1,1,2,2). Any ideas on how to setup a query to do this?
  3. Unfortunately the eval() did not work, so I continued to look around and actually stumbled on the answer: $types = str_repeat('s', count($bind_params)); array_unshift($bind_params, $types); array_unshift($bind_params, $stmt); call_user_func_array('mysqli_stmt_bind_param', $bind_params); (where $bind_params is the array of data) Works great and is very flexible!
  4. I'm working with prepared statements and need an array to be formatted in a certain way automatically. Lets say I've got $testarray, with varying amounts of parameters. I need to get this displayed as: mysqli_stmt_bind_param($stmt, 'sssss', $testarray[1],$testarray[2],$testarray[3],$testarray[4],$testarray[5]); How can I do this? The following will not work: $foo = $testarray[1],$testarray[2],$testarray[3],$testarray[4],$testarray[5]; mysqli_stmt_bind_param($stmt, 'sssss', $foo); Any ideas?
  5. Alright that I can do! Just had to make sure it was the only way... Thanks!
  6. fieldid fieldtype parentid fieldvalue 1 1 0 Clarity of Objectives 2 1 0 Conceptual/Theoretical Rigor 10 3 11,12,13,14,15 Recommendation So this way, when the fieldtype = 3 (a dropdown menu), I can then build out the option values.
  7. I can order by that, but then there is no guarantee the fieldtype = 3 and the associated parentids will fall in the same place
  8. Here's my current query, I can't figure this out: SELECT conf_review_fields.fieldid AS fieldid, conf_review_fields.fieldtype AS fieldtype, conf_review_fields.parentid AS parentid, conf_review_fields.fieldvalue AS fieldvalue FROM conf_review_fields, conf_review_form WHERE conf_review_form.topid = ? AND conf_review_form.fieldid IN (conf_review_fields.fieldid,conf_review_fields.parentid) ORDER BY conf_review_form.fieldorder ASC The relevant database structure for conf_review_fields and conf_review_form CONF_REVIEW_FIELDS fieldid mediumint( fieldtype tinyint(3) parentid mediumint( fieldvalue varchar(150) CONF_REVIEW_FORM topid mediumint( fieldid mediumint( fieldorder smallint(5) Running the above query with ? = 1, I get the following results: fieldid fieldtype parentid fieldvalue 1 1 0 Clarity of Objectives 2 1 0 Conceptual/Theoretical Rigor 13 3 10 Publish with major revisions 12 3 10 Publish with minor revisions 11 3 10 Publish as is 10 3 0 Recommendation 15 3 10 Not suitable 14 3 10 Revise and resubmit What needs to happen though, is that when the fieldtype = 3, with the parentid = 0, it then has other fields that reference that parentid (for example, all of the 10s). Is there a way to modify the query, using Group_concat or something else, that can pull those values into something I can loop through whenever a fieldtype = 3 and parentid = 0 is found?
  9. Thanks! I knew there had to be a function for that...
  10. I've pulled two strings from my database: keyid = (1,5,7) keyword = (foo1,foo2,foo3) I can convert them to their own arrays by using the explode function, however, the array is: array(0 => foo1, 1 => foo2, 2 => foo3); When I need it to match the keyid for each keyword: array(1 => foo1, 5 => foo2, 7 => foo3); How do I combine them like that?
  11. Perfect! Thank you! For anyone who made need more reference on that, this page does a great job explaining it: http://www.mysqlperformanceblog.com/2006/09/04/group_concat-useful-group-by-extension/
  12. This is actually now more suited for the PHP forum, thanks for the direction.
  13. Got a question on how to display this query correctly with PHP. SELECT papers.papid AS papid,papers.title AS title, keywords.keyword AS keyword FROM papers,keywords WHERE papers.topid = ? AND keywords.topid = papers.topid What I want to do here is only show the papid once, but this one papid may have multiple keywords that are found using this query. How do I make it display multiple keywords, but only one papid? Is this the correct way to go about it?
  14. Ok so lets say I do this: SELECT papers.papid AS papid,papers.title AS title, papers.authors AS authors, papers.status AS status_num, keywords.keyid AS keyid, keywords.keyword AS keyword FROM papers,keywords WHERE papers.topid = ? AND keywords.topid = papers.topid I then can echo all these values, however, keywords only displays the first keyword it found. How do I make it display multiple keywords (that it should have found with this query)
×
×
  • 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.