Jump to content

jepler

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.mytechmusings.com

Profile Information

  • Gender
    Male
  • Location
    San Diego, CA

jepler's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've got a strange problem. I'm generating a list of values (workshops) that are populated on a Web page as radio button choices. The user is required to only select one workshop during his/her registration. Everything works well on enrollment EXCEPT after I change the SQL sort statement to generate the list of workshops in a different order. Although the correct value appears to be populated in the radio value, it isn't posting as it is displayed (if that makes sense). To better illustrate, I created two example pages, one demonstrating the correct passing of the variable and one demonstrating the incorrect passing of the variable. To see for yourself, select the morning or afternoon classes on 9/5 on each page and click the "Register Me" submit button. The subsequent page shows the posted session id and the discrepancy based on the sort order. Correct passing of session example Incorrect passing of session example
  2. Hello, I'm trying to match a pattern that starts with the letters "tn" but could have a variety of characters after. I tried the following but it doesn't seem to work: if (preg_match("^tn%",$myword)) { do something...
  3. after reviewing what i just posted, i see i left out the original code I had a question about!! Sorry about that! Maybe I'm approaching it the wrong way? I want an input checkbox field to be checked and an OnClick event to be available if the item is in the array; if it's not, I want a different onClick event to be available in the input checkbox field. Seems like I can get the first condition to work but the second onClick event shows up in every input box regardless. <? <?php do { ?> <input name="<?php echo $row_Recordset1['schedule_id']; ?> " type="checkbox" id="<?php echo $row_Recordset1['schedule_id']; ?>" value="<?php echo $row_Recordset1['class_name']; ?>" <?php foreach($items as $item) {   if (strstr($row_Recordset1['schedule_id'], $item['id'])) {      $number += 10;     echo "checked onClick=goSomeWhere"; //if the schedule_id number IS found somewhere in the array item check the box and print this onClick function;   } else {     $number += 1;   } } if ($number > 10) {     echo "onClick=goSomeWhereElse";  //if the condition is not met above print this other function; ?> > <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  4. thanks for your reply. Okay, got it. But I guess that's not going to help me do what I want to do. Instead of performing a running tally, I guess I need instead to return the total for each instance of the loop and then set the number back to 0, or something. I want to do something like this: [code]<input name="<?php echo $row_Recordset1['schedule_id']; ?> " type="checkbox" id="<?php echo $row_Recordset1['schedule_id']; ?>" value="<?php echo $row_Recordset1['class_name']; ?>" <? if the schedule_id number IS found somewhere in the array item, echo "checked onClick=goSomeWhere"; if the schedule_id number is NOT found in the array item, echo "onClick=goSomeWhereElse"; ?> >[/code]
  5. I haven't created loops in PHP so I need some help. I'm trying to return a total arithematic value as items are looping. [code]foreach($items as $item) { if (strstr($row_Recordset1['schedule_id'], $item['id'])){ //if an item in the loop meets this condition $number+10 ; //add +10 to the number } $number + 1; } echo $number; //this should be the total value returned from the loop [/code] I know the code above is terrible but hopefully it can reveal what I'm trying to do.thx.
  6. If I build a search query similar to this: "SELECT DISTINCT object_id,object_title,object_description WHERE MATCH (object_id,object_title,object_description) AGAINST ('$keyword_search' IN BOOLEAN MODE)"; will it return both numeric and alpha matched results? In other words, I would like for the following result to be returned if someone types either "11.4" or "geography" in the keyword search field on my Web page. 11.4 Curriculum Guide Standard IIA 5 Themes of Geography
×
×
  • 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.