Jump to content

fillfry

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by fillfry

  1. can you post an example? I am trying to do something similar. thanks
  2. I acquired this code from a former developer and it only works in firefox. It is a three and sometimes four level dropdown depending on what you choose. It looks like it is using prototype and script.aculo.us <select id="text483" name="text483"> <option value="">Select One</option> <option value="PSYCH" name="pri_program" onClick="Element.update('prog_pri_div', psychology1);">Psychology</option> <option value="EDUC" name="pri_program" onClick="Element.update('prog_pri_div', education1);" class="validate">Education</option> </select> and based on those, would populate: <div id="prog_pri_div" name="prog_pri_div"></div> <div id="prog_sec_div" name="prog_sec_div"></div> <div id="prog_third_div" name="prog_third_div"></div> The "psychology1" and "education1" are actually variables in another part of the code and look like this: var psychology1 = ' <label for="text485">Select a degree:</label><br/> '+ '<select id="text485" name="text485">'+ '<option name="pri_plan" value="" class="validate">Select One</option>'+ '<option name="pri_plan" value="PDPSYCH" onClick="Element.update(\'prog_sec_div\', edlrntech);">Psy.D. in Clinical Psychology</option>'+ '<option name="pri_plan" value="MACLINPSY" onClick="Element.update(\'prog_sec_div\', psychloc);">M.A. in Clinical Psychology (Evening Format)</option>'+ '<option name="pri_plan" value="MACLINPSYD" onClick="Element.update(\'prog_sec_div\', psychday);">M.A. in Clinical Psychology (Malibu Campus Only)</option>'+ '<option name="pri_plan" value="MAPSYCH" onClick="Element.update(\'prog_sec_div\', psychloc);">M.A. in Psychology</option>'+ '</select>'; I would like to eventually rebuild this to use only jquery, but in the meantime, I just need something up. Any help would be great! Thanks and let me know if I need to give more code!
  3. Yeah, apparently. Thanks a lot, that worked. Now on to the other errors in the same file!!! Here is the wrap(): function wrap($it, $d = "'"){ if($it){ if(is_numeric($it)){ return $it; }else{ return $d . $it . $d; } }else{ return 'NULL'; } }
  4. this is what I get when I echo the $query: UPDATE student_info SET f_name = 'firstnameTest', m_name = ''Testing'', l_name = 'lastnameTest', email_personal = 'testacct@test.com', phone_number = '000-000-0000', contact_method = 'email', date_submitted = '2011/03/31', gender = 'M' WHERE cwid = 000000000 Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near 'Testing'. (severity 15)
  5. Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near 'Testing'. (severity 15) $query = "UPDATE student_info SET f_name = '".$post_vars['f_name']."', m_name = '". wrap($post_vars['m_name']) ."', l_name = '".$post_vars['l_name']."', email_personal = '".$post_vars['email_personal']."', phone_number = '".$post_vars['phone_number']."', contact_method = '".$post_vars['contact_method']."', date_submitted = '".date('Y/m/d')."', gender = '".$post_vars['gender']."' WHERE cwid = ".$cwid;
  6. Thanks Maq! When I added the single quotes I received the same error as before, just with ...Incorrect syntax near 'm_name'... early on, I thought it had something to do with the if(!($result = mssql_query($query))) die(...) cause those are the lines that the error_reporting(E_ALL) is giving me in the browser
  7. I have received this in the php error log: PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: message: Line 1: Incorrect syntax near '='. (severity 15) coming from somewhere in here: $query = "UPDATE student_info SET f_name = '".$post_vars['f_name']."', m_name = ". wrap($post_vars['m_name']) .", l_name = '".$post_vars['l_name']."', email_personal = '".$post_vars['email_personal']."', phone_number = '".$post_vars['phone_number']."', contact_method = '".$post_vars['contact_method']."', date_submitted = '".date('Y/m/d')."', gender = '".$post_vars['gender']."' WHERE cwid = ".$cwid; if(!($result = mssql_query($query))) die("Database Error: you might have already submitted the form. Error 1<br/>" . $footer); I am semi new to php and I acquired this with the job... Any help or suggestions would be AWESOME!!!! Thanks
×
×
  • 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.