Re: stupid question about a class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Kurth wrote:
>
> I have a stupid question but I can not figure it out
> I am using a class that creates the select statement for mysql.
> I am ale to add all the data with out any problem. But when I run the
> class to get the results. I can only see the results by running echo in
> front of the call to the class .
> echo $q->getQuery();
> Output SELECT * FROM listing WHERE state='wa'
> if I
> $q->getQuery();
> echo $g;
> Output Object id #1
> How do I use the results in my mysql query If I can not move it to a
> variable

You are confusing the object itself ($g) with one of its member functions
($g->getQuery())

If you echo $g, you will see only the object itself.
If you echo $g->getQuery() you will see the query you built.

If you want that query in a variable, you could do:
$query = $g->getQuery();
mysql_query($query);

You could even do:
mysql_query($g->getQuery());

But you wouldn't be able to do:
mysql_query($g);
because $g isn't a string, it's an object.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux