Help please: Substr a variable inside an array...

Hi all,
I have a little problem to solve… I use the following script to get the latest values from the ‘history’ table of my database.

My func works fine but i don’t know how to Substr the value of the ‘date’ values :oops:? Thanks in advance…

[code]$query = $DbLink->query(“SELECT * FROM history ORDER BY date DESC”);
$i = 0;

while ($historyx = mysql_fetch_array($query)) {
if ($i == 21) {
for ($i=0; $i< 2; $i++) {
$output_value .= ‘

  • ’.$historyx[‘id’].’–’.’$’.$historyx[‘login’].’–’.$historyx[‘date’].’
  • ’;


    [php]$query = $DbLink->query(“SELECT * FROM history ORDER BY date DESC”);

    while ($historyx = mysql_fetch_array($query)) {
    $output_value .= ‘

  • ’.$historyx[‘id’].’–’.’$’.$historyx[‘login’].’–’.substr ($historyx[‘date’],0,9).’
  • ’;

    im not sure what u try to achive by using brake.
    but it wan’t working as the foreach loop was setting $i back to 0 over and over again.

    Sponsor our Newsletter | Privacy Policy | Terms of Service