Jump to content

JBRTaylor

New Members
  • Posts

    5
  • Joined

  • Last visited

JBRTaylor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks so much, i can't tell you how long that has been sending me round the loop, lol. To help with my understanding, what is the check that is happening in the if ($group) statement? Thanks again Jon
  2. Hi I have a two dimensional array and would like to output the results in groups depending upon one of the fields in the array. While i have managed this and have figured out how to create a header for each group, i would now like to create a footer (end of group) line where i could create a subtotal or similar. my working code with the header is below but how do i add the footer? $group = null; for($i=0;$i<count($rowKitCharges);$i++){ if($rowKitCharges[$i]['SubCategory'] != $group) { //echo the group header echo "<br><b>" . $rowKitCharges[$i]['SubCategory'] . "</b><br>"; $group = $rowKitCharges[$i]['SubCategory']; } echo $rowKitCharges[$i]['HireID'] . " " . $rowKitCharges[$i]['SubCategory']; echo "<br>"; } Thanks Jon
  3. Hi, thanks for the quick reply. I am a beginner as u probably guessed, to help me understand could u provide an example of adding the array to a variable and then echoing it in a similar way to my example. Thanks
  4. Hi I am having problems running a while loop twice. The first loop runs fine but the 2nd one does not run. Can anyone please advise why this is? My code is below Thanks in advance. Jonathan $sql = "SELECT id, url, time FROM fyi_links"; $res = odbc_exec($con, $sql); while ($row = odbc_fetch_array($res)) { print($row['id'].",".$row['url'].",".$row['time']."\n"); } //Run loop again after some other code while ($row = odbc_fetch_array($res)) ​{ print($row['id'].",".$row['url'].",".$row['time']."\n"); }
  5. Hi As a beginner after much work i managed to display the results of a call to an access database as a list and have quite happy managed to get them to display as a list in a table. Below is the code i have used to do this. while($row = odbc_fetch_array($UserProdResults)) { echo $row['ProductionName'] . "<br>"; } What i would like to be able to do is to populate each cell of a table which is 3 columns wide with the results eg: Result 1 result 2 Result 3 Result 4 Result 5 Result 6 Result 7 etc.... At the moment i have only been able to populate the one column. Any help / advice very gratefully received. Jon
×
×
  • 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.