How to ad wthite space

Discussion in 'PHP' started by tasos55, Apr 15, 2013.

  1. #1
    Hello i try to ad a white space but i cant figure it out.
    I want to ad a space between AllCars like that All Cars
    and when i ad space you see this,
    Warning: Invalid argument supplied for foreach() in /domain/domain/domain/domaincom on line 11

    <?php
    include 'connect.php';
     
    $result = mysql_query("select
    (select count(1) FROM videos WHERE title LIKE '%Funny%') as Funny,
    (select count(1) FROM videos WHERE title LIKE '%Bikes%') as Bikes,
    (select count(1) FROM videos WHERE title LIKE '%Cars%') as AlCars");  <-------
                                                             
    $row = mysql_fetch_assoc($result);
     
    foreach($row as $title => $total)
    {
      echo '<div class="textbl">' . $title . ': ' . $total .'</div>';
    }
     
     
     
    ?>
    PHP:
    Thanks.
     
    Solved! View solution.
    tasos55, Apr 15, 2013 IP
  2. #2
    Try this way
    
    $result = mysql_query("select
    (select count(1) FROM videos WHERE title LIKE '%Funny%') as Funny,
    (select count(1) FROM videos WHERE title LIKE '%Bikes%') as Bikes,
    (select count(1) FROM videos WHERE title LIKE '%Cars%') as 'All Cars'");
    
    PHP:
     
    mak1084, Apr 15, 2013 IP
  3. tasos55

    tasos55 Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks it works.
     
    tasos55, Apr 15, 2013 IP