Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by sasa

  1. try

    <?php
    
    $images = "gallery/"; # Location of galleries
    $cols   = 4; # Number of columns to display 
    $max    = 6; # Maximum number of updates to show per page
    $page   = 2; # Page Number, if you have 9 tumb, on 2nd page is just 3
    
    if ($handle = opendir($images)) { 
       while (false !== ($file = readdir($handle))) { 
           if ($file != "." && $file != "..") { 
               $files[] = $file; 
           } 
       } 
       closedir($handle); 
    } 
    $colCtr = 0;
    echo "<div><table><tr>";
    rsort($files);
    $files = array_chunk($files, $max);
    $files = $files[$page - 1];
    foreach ($files as $file) //$i = $c, $i is greater than the array count minus $max, $i de-increments on each loop.  This will give us a countdown for the number of updates required.
    { 
      if($colCtr == 0) echo "<tr>"; 
      echo "<td><img src=\"" . $images . $file . "/thumb.jpg\" width=\"240px\" height=\"180px\" alt=\"" . $alt . "\" /></td>";
      $colCtr++;
      if ($colCtr == $cols){
          echo '</tr>';
          $colCtr = 0;
      }
    } 
    if ($colCtr > 0)    echo '</tr>';
    
    echo "</table></div>" . "\r\n"; 
    
    ?>

  2. $nextVar = 'roundx';
    $lett = array(1 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');
    $count = 0;
    $queryU =  "SELECT * FROM one WHERE username = '".$Var."'";
    $result = mysql_query($query);
    $score = mysql_fetch_assoc($result);
    //$usera1 = $score['round1'];
    $nextVar = 'roundx';
    $queryx =  "SELECT * FROM acs WHERE round1 = '".$nextVar."'";
    $resultx = mysql_query($queryx);
    $scorex = mysql_fetch_assoc($resultx);
    //$win1 = $score['inxa'];  
    for($i = 1; $i <= 8; $i++) $count += $score['round'.$i]==$score['inx'.$lett[$i]] ? 1 : 0;
    
    echo $count;

    btw for what is $scorex?

     

    not tested

  3. change query to

    $GetTimeTable = "SELECT * FROM timetable WHERE username='$username' AND Subject_date='$today_date' and end_time" > $timeNow ORDER BY end_time;

    in 1st row of returned data  is curren class (if it exist) and in another row(s) is future clasesses

    for current class just check if start_time is less then current time

  4. try

    <?php
    include 'config0.php';
    $search=$_GET["search"];
    // Connect to server and select database.
    mysql_connect($dbhost, $dbuser, $dbpass)or die("cannot connect");
    mysql_select_db("$dbname")or die("cannot select DB");
    $result = mysql_query("SELECT * FROM table1 WHERE plaques LIKE '%$search%' ORDER BY `year`") or die(mysql_error());
    // store the record of the "" table into $row
    //$current = '';
    // keeps getting the next row until there are no more to get
    if($result && mysql_num_rows($result) > 0) {
        $i = 0;
        $max_columns = 4;
        $y = mysql_result($result, 0, 'year');
        echo "<table align=center>";
    echo "<br>";
        while($row = mysql_fetch_array($result)) {
           // make the variables easy to deal with
           extract($row);
           if($y != $year){
               $y = $year;
               if($i >0) {
                   for($j=$i; $j<$max_columns; $j++) echo "<td> </td>";
                   echo "</tr>\n";
                   $i = 0;
               }
           }
    
           // open row if counter is zero
           if($i == 0) echo "<tr>";
           echo "<td align=center>";
    ?>
              <div style="float: left;">
                <div><img src="<?php echo $tn; ?>"></div>
      </div>
    <?php
           echo "</td>";
           // increment counter - if counter = max columns, reset counter and close row
           if(++$i == $max_columns) {
               echo "</tr>";
               $i=0;
           }  // end if
       } // end while
    } // end if results
    
    // clean up table - makes your code valid!
    if($i > 0) {
        for($j=$i; $j<$max_columns;$j++)
            echo "<td> </td>";
       echo '</tr>';
    }
    mysql_close();
    ?>

  5. are you traying this

    <?php
    require_once ('includes/config.php');
    require_once ('includes/connect.php');
    
    $echoarray = array();
    $resultsql = mysql_query("SELECT * FROM clients")or die(mysql_error());
    while($row = mysql_fetch_array($resultsql)){
        $echoarray[] = array(
            'id' => $row['ID'],
            'name' => $row['First_Name'] . " " . $row['Last_Name'],
            'price' => $row['Status'],
            'number' => $row['Sex'],
            'address' => $row['Phys_Street'],
            'company' => $row['Agency'],
            'desc' => $row['Notes'],
            'age' => $row['Date_Birth'],
            'title' => $row['Occupation'],
            'phone' => $row['Phone'],
            'email' => $row['Email'],
            'zip' => $row['Phys_Zip'],
            'country' => $row['Phys_City']
        ); 
    }
    ?>

×
×
  • 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.