php-general Digest 24 Nov 2009 02:54:56 -0000 Issue 6457

Topics (messages 300038 through 300043):

Re: Change styling depending on var value
        300038 by: Phil Matt

Re: PHP and XML
        300039 by: Nathan Rixham

function not returning query
        300040 by: Allen McCabe
        300041 by: Phpster

Query based on Server offset TimeStamp
        300042 by: Don Wieland

Re: My experience with the "Forms Generation and Validation" class
        300043 by: Manuel Lemos

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Mari Masuda wrote:

This may be a dumb question, but did you actually fetch the db query's results 
and put them in $row before trying to use $row?  In MySQL you could do 
something like:

$query = "select * from my_table";
$result = mysql_query($query);
$row = mysql_fetch_array($result);  //this statement would need to be inside of 
a loop if there is more than one result

Thanks, Mari. That was it: I usually declare the variables first, then on with the rest of the code. I had inserted the $row conditional values right after the vars, before the rest of the query...just plain dumb.

Cheers --- Phil

--- End Message ---
--- Begin Message ---
Juan Marcelo Rodríguez Monti wrote:
> Hi people,
> I have some doubts about this topic that I'm gonna explain.
> 
> I have a few sites in flash, and I was requested to write a PHP frontend
> to send news. I have this already done and it works perfect. It's a LAMP
> App to send and edit news, post video, images and so on.
> 
> Then, I need to put all this news into the Flash site. So, I need to use
> XML. I'm not gonna discuss about Flash, because this is a PHP List,
> however I would like to talk about PHP and XML.
> 
> What do you recommend me to produce XML from those news of the SQL
> database?. What do you suggest to output XML from the existing content
> to then put those XML files into Flash.
> 
> The posted news are saved in a MySQL database. I don't know if do I need
> to output from PHP then parse the output and convert it to XML, or if Do
> I need to get the array from the MySQL and directly output this to an
> XML file to then get from this file from Flash.
> 
> Thanks,
> Juan.
> 

flash remoting: you could use amf instead; its faster and easier to use.

on the php side just use http://amfphp.org/ or suchlike

--- End Message ---
--- Begin Message ---
Hi, thanks for reading, I hope you can help:

In my main file for an orders page I have the following code:


if (isset($_GET['filterby']))
 {
  $resultOrders = adminFilterQuery();
  $numberOfOrders = mysql_num_rows($resultOrders);
 }
 else
 {
  $resultOrders = mysql_query("SELECT * FROM afy_order;") or
die(mysql_error("Could not query the database!"));
  $numberOfOrders = mysql_num_rows($resultOrders);
 }


adminFilterQuery() is a custom function that is supposed to return a
mysql_query, here are the last few lines of this function:


$query = "SELECT * FROM afy_order WHERE school_id = '{$school}' ORDER BY
{$order_by_param};";
$result = mysql_query($query);
return $result;

l am getting this error when I try to filter my query using a form in tandem
with the quey building function:

*Warning*: mysql_num_rows(): supplied argument is not a valid MySQL result
resource

where the line is the one where I use the mysql_num_rows function.

What am I missing here?

Thanks!

--- End Message ---
--- Begin Message ---
Likely your query failed due to an error.

Try adding an or die(mysql_error()) to the end of your mysql_query statement to see what that error maybe

Bastien

Sent from my iPod

On Nov 23, 2009, at 7:22 PM, Allen McCabe <allenmcc...@gmail.com> wrote:

Hi, thanks for reading, I hope you can help:

In my main file for an orders page I have the following code:


if (isset($_GET['filterby']))
{
 $resultOrders = adminFilterQuery();
 $numberOfOrders = mysql_num_rows($resultOrders);
}
else
{
 $resultOrders = mysql_query("SELECT * FROM afy_order;") or
die(mysql_error("Could not query the database!"));
 $numberOfOrders = mysql_num_rows($resultOrders);
}


adminFilterQuery() is a custom function that is supposed to return a
mysql_query, here are the last few lines of this function:


$query = "SELECT * FROM afy_order WHERE school_id = '{$school}' ORDER BY
{$order_by_param};";
$result = mysql_query($query);
return $result;

l am getting this error when I try to filter my query using a form in tandem
with the quey building function:

*Warning*: mysql_num_rows(): supplied argument is not a valid MySQL result
resource

where the line is the one where I use the mysql_num_rows function.

What am I missing here?

Thanks!

--- End Message ---
--- Begin Message ---
Hello,

I have a mySQL database server in Florida USA (EST) and I want to do a query on a record in California, USA (PST) 3 hours earlier using PST instead of EST.

I would like to add to my CORE page that offset of the timezone so I can use it in a query like:

Select * FROM aTable WHERE ServerOffsetTimeStap >= Row_Start_TimeStamp AND ServerOffsetTimeStap <= Row_End_TimeStamp

How would I do this?

Appreciate any help you can offer. Thanks!


Don Wieland
D W   D a t a   C o n c e p t s
~~~~~~~~~~~~~~~~~~~~~~~~~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at:
http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher
http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html


--- End Message ---
--- Begin Message ---
Hello Anonymous complainer,

on 11/22/2009 09:23 AM LinuxManMikeC said the following:
> Just like to share my real world experience with Manuel Lemos'
> "formsgeneration" library.
> http://www.phpclasses.org/formsgeneration
> 
> At work early this summer we had a project under a tight deadline that
> needed unified form creation, processing, and error reporting.  I had
> seen Manuel promoting his formsgeneration class on the mailing list
> and thought I'd look into it to help keep the project within the
> deadline.  I read some positive reviews and comments, the demos looked
> promising, and the interface seemed good enough.  Little did I know
> the headaches I was in for.  I found the configuration structures and
> interface to be extremely cumbersome, not to mention terribly
> documented.  The interface seems quite inefficient and in most cases
> its easier just to throw together a form and validation code by hand.
> Usage was often convoluted, and due to the poor documentation I spent
> half my effort trying to decipher the interface.  And it was difficult
> to customize in several areas.  While it can work well enough in
> several simple cases, in my opinion it is too cumbersome for any
> significant form processing project, especially in the business world.
>  I ended up wasting a week of work using the formsgeneration class and
> had to redo the project making my own form utility code from scratch
> as I went (which took just as much time and actually worked as
> intended).  Granted I did make the mistake of not giving myself enough
> evaluation time before the project.  I just want caution others to
> carefully evaluate this code before deciding to use it in their
> projects, especially since Manuel seems so eager to promote his code
> (and his web site) whenever the opportunity arises.  And in general,
> to be cautious and take your time when evaluating any 3rd party code
> for production use.

There seems to be a misunderstanding. I am not eager to promote my code.
I just look forward to have my classes tested by as many people as
possible, so I get as many bug reports and feature improvements as possible.

The fact is that I developed this and many other packages for my own
purposes. Nowadays I could not live without them because they make me
several orders of magnitude more productive than if I had to do it edit
HTML code mannually as you said you did.

Anyway, maybe this surprises you, but I like criticism. Especially
constructive criticisms from people that are able to give specific
examples of what they do not like, instead of making vague claims as you
did.

I like constructive criticism because it helps me making my code better,
more useful to others and ultimately to myself. That is why I publish my
work as Open Source.

Unfortunately you did make any constructive criticism. There seems to be
no way to improve my work because you were not specific to what exactly
you find cumbersome, even less what you would different to make it less
cumbersome.

I never claimed it would be perfect for everybody. What is good and
productive for some, maybe hard and difficult for others, especially if
you try to learn all by yourself and never ask for help.

The class has a support forum where you can ask questions and always get
a response so you never get stuck.

http://www.phpclasses.org/discuss/package/1/

Anyway, I don't know if you ever asked for help because you are using an
anonymous identity here. Actually, I wonder why you bother to write a
special message anonymously just campaign against the forms class. It
makes me wonder if you have other reasons to do it that you may not be
revealing unrelated with the class.

Anyway, I am not upset. I am just sorry that you made many criticisms
without giving real examples to demonstrate your points. That way it
will not be helpful to anybody.


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---

Reply via email to