Tasos Posted April 15, 2013 Share Posted April 15, 2013 Hello i try to add a white space but i cant figure it out.I want to add a space between AllCars like All Carsand when i add space you see this,Warning: Invalid argument supplied for foreach() in /domain/domain/domain/domain.com on line 11 Can anyone please help me ? <?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>'; } ?> THANKS Quote Link to comment Share on other sites More sharing options...
trq Posted April 15, 2013 Share Posted April 15, 2013 $row is not an array. Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted April 15, 2013 Solution Share Posted April 15, 2013 Use backticks ... as `All Cars` Quote Link to comment Share on other sites More sharing options...
Tasos Posted April 15, 2013 Author Share Posted April 15, 2013 @ Guru Thank`s Quote Link to comment Share on other sites More sharing options...
Jessica Posted April 15, 2013 Share Posted April 15, 2013 Guru Thank's what? Quote Link to comment Share on other sites More sharing options...
Tasos Posted April 15, 2013 Author Share Posted April 15, 2013 O sorry i mean Barand, thanks for the ' ' . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.