Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 15th, 2013, 08:09 AM
Germaris Germaris is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Pierrefonds, QC Canada
Posts: 205 Germaris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 22 h 19 m 6 sec
Reputation Power: 10
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Unexpected return...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap