January 15th, 2013, 08:09 AM
-
Unexpected return...
Hi there!
This query :
PHP Code:
SELECT img_name FROM $table WHERE email = '$email' AND ok = '1' ORDER BY id DESC LIMIT 0 , 3") or die("&error=Failed !");
is supposed to return a 2 elements "array" (as I already know the content of $table satisfying to the query statements). I know it's not actually an array but a string with a "|" delimiter...
"ok" is a column which content is 1 (valid image) or 0 (invalid image)
there's 3 rows containing the required $email and only two where ok='1'
Statement
PHP Code:
if ( mysql_num_rows($sql) > 0) {
while ($row =mysql_fetch_array ($sql)) {
$array .= $row['img_name']."|";
}
print "&numberOfRows=".mysql_num_rows($sql)."&myArray=".$array;
}
else {
print "&error=No images found.";
}
returns a wrong number of rows (3 instead of 2) but a right "array" !!!???
Why?
Many thanks for your advices, remarks and suggestions!
Last edited by Germaris; January 15th, 2013 at 12:32 PM.