Jump to content

blev

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks alot. The code didn't directly work but used the functions to gain the required result
  2. I have this code and only wish display the first three records from the array. I've tried using the LIMIT 3 in the sql statement but this does not work. Can anyone help me please???? thanks [code] foreach ($club_score_array as $key => $val)             {                             $query3 = mysqli_query($conn, "SELECT * FROM event, venue WHERE event.venue = venue.venueName AND event.date <= '$mysqlWeek' AND event.eventID = '$key' LIMIT 3") or die('Error, query failed');                       while ($row = mysqli_fetch_array($query3))                         {                             $i++;                                                          $details = $row['details'];                             $details_short = substr($details, 0,100);                             echo "<table width='800'>                             <tr><td><span class='h1'>$i</span></td><td>&nbsp;</td></tr>                                <tr>                                  <td width='700'><span class='h2'><a class=h2link href='eventDisplay.php?eventID=".$row['eventID']."'>".$row['eventName']."</a> @ <a class=h2link href='clubnightDisplay.php?clubname=".$row['club']."'>".$row['club']."</a></span></td>                                  <td width='100' rowspan='4' align='right'><img src='images/flyers/".$row['flyerName']."' width='50' /></td>                                </tr>                                <tr>                                  <td><span class='h2'><a class=h2link href='venueDisplay.php?venueName=".$row['venue']."'>".$row['venue']."</a>, ".$row['location']."</span></td>                                 </tr>                                <tr>                                  <td><span class='h3'>".$row['time']." -> ".$row['admission']."</span></td>                                 </tr>                                <tr>                                                                                                               <td>".$row['lineup']." -> $details_short...</td>                                 </tr>                              </table><br />";                         }                         mysqli_free_result($query3);             } [/code]
  3. this is starting to hurt my head now. why doesn't the statement like the "LIMIT". is it because it is in another while loop?? i'm stuck. any help would be gratefully appriciated. thanks
  4. When i apply LIMIT in this piece of code it does not work. can anyone tell me why???? also, when i try to replicate a similar loop below it but slightly different it does not display any results. Can anyone tell me why??? thanks! [code] while(list($key, $val) = each($club_score_array))             {                     $query3 = mysqli_query($conn, "SELECT * FROM event, venue WHERE event.venue = venue.venueName AND event.date <= '$mysqlTwoDays' AND event.eventID = '$key' [b]LIMIT 1[/b]") or die('Error, query 3 failed');                                            while ($row = mysqli_fetch_array($query3))                         {                             echo "<table width='700'>                                <tr>                                  <td width='600'><span class='h2'><a class=h2link href='eventDisplay.php?eventID=".$row['eventID']."'>".$row['eventName']."</a> @ <a class=h2link href='clubnightDisplay.php?clubname=".$row['club']."'>".$row['club']."</a></span></td>                                  <td width='100' rowspan='4' align='right'><img src='images/flyers/".$row['flyerName']."' width='50' /></td>                                </tr>                                <tr>                                          <td><span class='h2'><a class=h2link href='venueDisplay.php?venueName=".$row['venue']."'>".$row['venue']."</a></span></td>                                 </tr>                                                                 <tr>                                  <td><span class='h3'>".$row['time']." -> ".$row['admission']."</span></td>                                 </tr>                                <tr>                                  <td>".$row['lineup']." -> ".$row['details']."</td>                                 </tr>                              </table><br />";                         }                         mysqli_free_result($query3);             }         } [/code]
  5. i've tried this on the above code with no joy. any idea's??? i've also tried it in a seperate piece of code it works fine. :-(
  6. I have this piece of code which uses values from an array to get data from a database. Where/how do i make a simple for/ foreach loop to collect, say the first 3 records. thanks in advance [code] while(list($key, $val) = each($club_score_array))     {         $query3 = mysqli_query($conn, "SELECT * FROM event, venue WHERE event.venue = venue.venueName AND event.date <= '$mysqlTwoDays' AND event.eventID = '$key'") or die('Error, query failed');              while ($row = mysqli_fetch_array($query3))             {             echo "<table width='700'>                 <tr>                 <td width='600'><span class='h2'><a class=h2link href='eventDisplay.php?eventID=".$row['eventID']."'>".$row['eventName']."</a> @ <a class=h2link href='clubnightDisplay.php?clubname=".$row['club']."'>".$row['club']."</a></span></td>                                  <td width='100' rowspan='4' align='right'><img src='images/flyers/".$row['flyerName']."' width='50' /></td>                                </tr>                                <tr>                                          <td><span class='h2'><a class=h2link href='venueDisplay.php?venueName=".$row['venue']."'>".$row['venue']."</a></span></td>                                 </tr>                                                                                            </table><br />";                         }                         mysqli_free_result($query3);             }[/code]
  7. Can anyone point me in the way of a good tutorial or example code concerning drop down lists that change when you select an option, instead of selecting an option and then clicking submit here's an example of this [a href=\"http://www.soccerstats.com/\" target=\"_blank\"]http://www.soccerstats.com/[/a] in the top left hand corner there is a drop down box that says select league
  8. Thats great, thanks. How do I loop through the results of the clubmusic styles storing that in an array for each club???? this is the part that i'm struggling with most. any help appriciated
  9. first off, hello. First post on this board. I'm trying compare a users music style with the music styles for various club nights and find out which is better suited. How do add the various music styles into an arrays so i can compare these results to that array i created with the users music preference e.g. The users array will contain (jazz, pop, disco) and club 1 array has ([i]jazz[/i], classical, punk) club 2 array has ([i]pop[/i], [i]disco[/i]) club 1 would then score 1 because it matched 1 style from the users first array and be added to another new array club 2 would score 2 and be added ahead club 1 in the new array. hope someone can help.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.