last day (14 days later) » 

12:22 PM
0
A: change the class for the first row extend from mysql with PHP

Yair.RChange the code like this: <?php $getBanner = $db->prepare("SELECT * FROM banner_english"); if ($getBanner->execute()) { $results = $getBanner->get_result(); $rows = $results->fetch_all(MYSQLI_ASSOC); $ind = 0; foreach ($row...

 
I am getting Notice: Array to string conversion for var $image
 
O yeah, change to: foreach ($rows['image'] as $image) {
 
didn't solve the issue it says Notice: Undefined index: image in can't I print_r the $image?
 
Do you really need ALL the data from table? maybe instead of SELECT *, do SELECT image FROM....
 
you are right about this I changed it to SELECT image but still the same issue if for each is foreach ($rows as $image) { it's says Notice: Array to string conversion and if I changed to foreach ($rows['image'] as $image) { it says Notice: Undefined index: image in
 
12:22 PM
can you do var_dump($rows) and tell me what it shows you?
 
`array (size=2)
0 =>
array (size=1)
'image' => string '06.jpg' (length=6)
1 =>
array (size=1)
'image' => string '03.jpg' (length=6)`
that what I got on var_dump($rows)
 
ok all you need to do is
foreach($rows[0] as $image)
tell me if that works
 
yes but this will get just one item as we selected $rows[0] only
so on var_dump I see the two banners but in the HTML it just show one banner
 
Ok ill post a new code in the page with the new fixes
 
thanks you very much, you can edit you code
 
12:32 PM
posted a new one :)
 
Thanks very much Yair.R it's working
 
yw, have a great day!
 

last day (14 days later) »