2017년 1월 5일 목요일

Help with error occured when trying to load from my database


Here is the error i get when trying to load from my database.

Select list item: Attempt to get item number 2 of a list of length 1: (<br />)

What i am doing here is collecting information, then saving it to the database. At a later time when i try to recall the information i get this error. Any ideas??

--
Can you show us the blocks that deal with the list?

--
also use Do it to debug your blocks, see tip 4 here

--
this is the error from the do it blocks..

Error from Companion: Select list item: Attempt to get item number 2 of a list of length 1: (<b>Notice</b>: Undefined variable: csv_output in <b>/var/www/html/custcsv.php</b> on line <b>29</b><br />)

--
line 26 $values = mysqli_query($dbc, "SELECT * FROM customer");
line 27 while ($rowr = mysqli_fetch_row($values)) {
line 28  for ($j=0;$j<$numberOfRows;$j++) {
line 29  $csv_output .= $rowr[$j].", ";
line 30 }
line 31 $csv_output .= "\n";

--
 Undefined variable: csv_output in <b>/var/www/html/custcsv.php

it seems to be, there is an error in your php script, so what about defining that variable first?
see also my working example here https://puravidaapps.com/mysql.php


-- 
Select list item: Attempt to get item number 2 of a list of length 1: (<br />)
error.jpg 표시 중

-- 
use Do it to debug our blocks, see also tip 4 here
Top 5 Tips: How to learn App Inventor

as the error message is trying to tell you, your sublist only contains one item, which is <br />
you can't select a second item of a list which ony has one item


-- 
Don't assume that Web1.GotText will always give you properly formatted data for a csv table conversion.
It's like drinking from a faucet right after the Water Department flushed the lines for sediment.

Create a new global variable ResponseContent and set it to the responseContent you receive at the entry to Web1.GotText 
so you can drop it into a Label.Text or a DoIt to see what kind of polluted data you are trying to digest.

-- 


댓글 없음:

댓글 쓰기