Re: [PHP] Returning results

2010-10-21 Thread Jim Lucas
Daniel P. Brown wrote:
> On Wed, Oct 20, 2010 at 21:04, Bastien  wrote:
>> Yeah, it's got a few downsides!
> 
> The next app for the iPhone should be a modification to the
> spell-check to verify PHP functions in emails.
> 

+1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Returning results

2010-10-20 Thread Daniel P. Brown
On Wed, Oct 20, 2010 at 21:04, Bastien  wrote:
> Yeah, it's got a few downsides!

The next app for the iPhone should be a modification to the
spell-check to verify PHP functions in emails.

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Returning results

2010-10-20 Thread Bastien
Yeah, it's got a few downsides!

Bastien Koert
905-904-0334
Sent from my iPhone

On 2010-10-20, at 8:27 PM, "Daniel P. Brown"  wrote:

> On Wed, Oct 20, 2010 at 20:11, Bastien  wrote:
>> 
>> David, the $result variable/object is the handle to the result data set, not 
>> the resulting data. You would still need to access the data set via the 
>> Mysql_* set of functions like Mysql-fetch_array or Mysql_result like you did 
>> in the second example
> 
>Must've been typing from the iPhone here.  ;-P
> 
> -- 
> 
> Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
> (866-) 725-4321
> http://www.parasane.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Returning results

2010-10-20 Thread David McGlone
On Wed, 2010-10-20 at 20:11 -0400, Bastien wrote:
> 
> On 2010-10-20, at 7:59 PM, David McGlone  wrote:
> 
> > Hi everyone, it's me again :-/
> > 
> > I'm having a whole lot of trouble figuring out how to return a result
> > from a query such as in this code example:
> > 
> > function LearnIt(){
> >  $query = "SELECT learn_id FROM mydatabase ";
> >  $result = mysql_query($query);
> >  return $result;
> >  }
> > 
> > I already achieved a connection to the database with no problem, to
> > verify I wrote this query also:
> > 
> > function GetMeARow(){
> > 
> >  $query = "SELECT learn_id FROM mydatabase ";
> >  $result = mysql_query($query);
> >  while($row = mysql_fetch_array($result)){  
> >  echo $row[learn_id];
> >  }
> > 
> > With the latter, It works as expected, echoing the 2 rows I have in the
> > DB, but I'm trying to understand the method used in the former.
> > 

> 
> 
> David, the $result variable/object is the handle to the result data set,
> not the resulting data. You would still need to access the data set via
> the Mysql_* set of functions like Mysql-fetch_array or Mysql_result like
> you did in the second example

HaHa! How burnt out does one have to be to overlook this a million times
and still not get it?

Thanks I see now :-)

-- 
Blessings
David M.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Returning results

2010-10-20 Thread Daniel P. Brown
On Wed, Oct 20, 2010 at 20:11, Bastien  wrote:
>
> David, the $result variable/object is the handle to the result data set, not 
> the resulting data. You would still need to access the data set via the 
> Mysql_* set of functions like Mysql-fetch_array or Mysql_result like you did 
> in the second example

Must've been typing from the iPhone here.  ;-P

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Returning results

2010-10-20 Thread Bastien


On 2010-10-20, at 7:59 PM, David McGlone  wrote:

> Hi everyone, it's me again :-/
> 
> I'm having a whole lot of trouble figuring out how to return a result
> from a query such as in this code example:
> 
> function LearnIt(){
>  $query = "SELECT learn_id FROM mydatabase ";
>  $result = mysql_query($query);
>  return $result;
>  }
> 
> I already achieved a connection to the database with no problem, to
> verify I wrote this query also:
> 
> function GetMeARow(){
> 
>  $query = "SELECT learn_id FROM mydatabase ";
>  $result = mysql_query($query);
>  while($row = mysql_fetch_array($result)){  
>  echo $row[learn_id];
>  }
> 
> With the latter, It works as expected, echoing the 2 rows I have in the
> DB, but I'm trying to understand the method used in the former.
> 
> -- 
> Blessings
> David M.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


David, the $result variable/object is the handle to the result data set, not 
the resulting data. You would still need to access the data set via the Mysql_* 
set of functions like Mysql-fetch_array or Mysql_result like you did in the 
second example

Bastien Koert





> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] returning results of cURL POST

2003-02-08 Thread Lowell Allen
> From: Lowell Allen <[EMAIL PROTECTED]>
> 
[snip]
> 
> // check cURL results
> if ((trim($curl_results) != 1) || (trim($curl_results) != 0)) {
> // maybe nothing returned, bail out
> echo("Can't confirm results of attempt to add to database!\n");
> exit;
> }

I knew I'd find a stupid mistake as soon as I posted the question. I was
using a condition that could never be true, instead, I needed:

if ((trim($curl_results) != 1) && (trim($curl_results) != 0))

Sorry.

--
Lowell Allen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php