Jump to content

Jim R

Members
  • Posts

    955
  • Joined

  • Last visited

  • Days Won

    1

Community Answers

  1. Jim R's post in Using multiple variables to create an array... was marked as the answer   
    This works. 
    $year = $_GET['&year']; $team = $_GET['&team']; $number = $year.$team; // echo $number; $calendars = array ( '192' =>'2019roots', '212' =>'2021roots', '191' =>'2019grind', '201' =>'2020grind', '211' =>'2021grind', '221' =>'2022grind', '231' =>'2023grind' ); echo $calendars [$number]; echo do_shortcode( '[calendarizeit calendar="'. $calendars [$number] .'"]' );
  2. Jim R's post in Conditional Header redirect not working... was marked as the answer   
    I figured out there was an Ajax setting blocking the redirect with the form plugin I'm using.  No clue why it would do that, but by turning it off it took care of my problem.  
     
    As always, guys, thank you for your time and help.  
  3. Jim R's post in Data from form showing up, but not sure why query can't match it... was marked as the answer   
    OK...I got it to work.  I have no clue how it's much different than any of the versions I had before.  Earlier it wasn't picking up whether or not it was finding Rows.  It just kept saying NULL.  I look at what I have now, which works, and it makes sense, but I can't really decipher how it was different.  Now it even shows 0 vs. NULL.  
     
    I may have the queries wrong and functions right, then spent too much time messing with the functions.  Anyway, below is the final code.  
     
     
    (I removed the log input lines I had in previous versions.)
    $data = array( 'f_school' => $form->getValue('quform_1_7'), 'f_grade' => $form->getValue('quform_1_5'), 'f_nameFirst' => $form->getValue('quform_1_3'), 'f_nameLast' => $form->getValue('quform_1_4') ); $nameFirst = $data['f_nameFirst']; $nameLast = $data['f_nameLast']; $grade = $data['f_grade']; include (ABSPATH ."resources/connection.php"); $query = "SELECT nameFirst, nameLast, grade FROM a_players WHERE nameFirst = '{$data['f_nameFirst']}' AND nameLast = '{$data['f_nameLast']}' AND grade = '{$data['f_grade']}'"; $results = mysql_query($query); $num_rows = mysql_num_rows($results); if (($num_rows) == 0) { $query = "INSERT INTO a_players (grouping, school, grade, nameFirst, nameLast) VALUES ('4', '{$data['f_school']}', '{$data['f_grade']}', '{$data['f_nameFirst']}', '{$data['f_nameLast']}')"; $results = mysql_query($query); }
  4. Jim R's post in My css changes are suddenly not being reflected... was marked as the answer   
    I appreciate the help on this.  I decided to stick my 'header' into a <th> then removing the border <th> border.  It cleaned right up.  
  5. Jim R's post in Another Triggers question... was marked as the answer   
    Found the answer in this line right here:
     
    2/ Do not use UPDATE statement, use simple SET NEW.attribute.
     
    The trigger that worked:
    Action Time:  Before Event:  Insert set NEW.wpSlug = concat(lower(NEW.nameFirst),'-',lower(NEW.nameLast))
×
×
  • 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.