Jump to content

dmllc

Members
  • Posts

    11
  • Joined

  • Last visited

dmllc's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. dmllc

    outer inner loop

    aggg....facepalm....thx
  2. dmllc

    outer inner loop

    im not sure i understand. for example, if there were 8 records returned, i need the output to be like. <div class="pane"> <div class="row">record 1</div> <div class="row">record 2</div> <div class="row">record 3</div> <div class="row">record 4</div> <div class="row">record 5</div></div><div class="pane"> <div class="row">record 6</div> <div class="row">record 7</div> <div class="row">record 8</div></div>
  3. what datatype is the column where 123 is pulled from? your code has it in a string, but more than likely it is stored in mysql as an int
  4. dmllc

    outer inner loop

    i need help with inner/outer looping of a database recordset. i am not sure how to loop the database records in the manner i need. i need to create the following html structure:<div class="pane"> <- repeated total rows / rows per pane <div class="row">city</div> <- repeated n times where n is defined in a variable</div>this is what i have so far...<?if ($rGetCityHotels = $mysqli->query($qGetCityHotels)) { // get number of rows in results $total_rows = $rGetCityHotels->num_rows; // define number of rows to display per pane $rows_per_pane = 5; // define the number of panes $num_panes = ceil($total_rows / $rows_per_pane); for ($p=1; $p <= $num_panes; $p++){ echo '<div class="pane">'; $r=0; while($row = mysqli_fetch_assoc($rGetCityHotels)) { $r++; echo '<div class="row">'.$row[name].'</div>'; if ($r = $rows_per_pane){ break; } } echo '</div>'; }}?>but, my logic builds the following structure:<div class="pane"> <div class="row">American Vacation Homes</div></div><div class="pane"> <div class="row">Baymont Inn & Suites</div></div>etc... what am i doing wrong?
  5. dmllc

    xquery help

    i think i found a way to accomplish what i want, but the xpath function is not working like i thought it would.<xsl:value-of select="substring('pubDate',1,15)" /> is returning the string pubDate instead of the first 15 characters of a xml pubDate value: Thu, 01 Jun 2006 15:45:00 EDTwhat is the correct xpath function to display Thu, 01 Jun 2006 15:45:00 EDT as Thu, 01 Jun 2006?
  6. dmllc

    xquery help

    http://mlb.mlb.com/partnerxml/gen/news/rss/nym.xmli am trying to select the items that were published on the same date but i am not sure how to do this due to the format of the pubDate element. currently i am simply using <xsl:value-of select="pubDate"/>. also, is there a way to display the pubDate without the time string?
×
×
  • Create New...