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 Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/ Share on other sites More sharing options...
trq Posted April 15, 2013 Share Posted April 15, 2013 $row is not an array. Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/#findComment-1424810 Share on other sites More sharing options...
Barand Posted April 15, 2013 Share Posted April 15, 2013 Use backticks ... as `All Cars` Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/#findComment-1424812 Share on other sites More sharing options...
Tasos Posted April 15, 2013 Author Share Posted April 15, 2013 @ Guru Thank`s Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/#findComment-1424864 Share on other sites More sharing options...
Jessica Posted April 15, 2013 Share Posted April 15, 2013 Guru Thank's what? Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/#findComment-1424885 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 ' ' . Link to comment https://forums.phpfreaks.com/topic/276966-how-to-add-white-space/#findComment-1424926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.