Hello,

mysql_query() returns non-false even if there was an
UPDATE statement and the query was successful.

But if I put the $result variable in mysql_num_rows()
it returns an error, $result in invalid handle. 

I was asking how to know that where its an UPDATE
statement so I dont call mysql_num_rows() at all.

The problem is that if I set error_reporting( 0 ),
everything works but we are required to have
error_reporting ( E_ALL )

Regards,
Karam



--- Chris <[EMAIL PROTECTED]> wrote:

> Karam Chand wrote:
> 
> >Hello,
> >
> >I have an app where one module is similar to
> >phpMyAdmin (well only .1%) with error_reporting()
> set
> >to E_ALL.
> >
> >Now a user can execute any query. What is the best
> way
> >to know whether a query is result or non-result.
> >
> >e.g.
> >
> >  
> >
> . . .
> 
> >Thanks in advance 
> >
> >Regards,
> >Karam
> >
> >  
> >
> 
> As it states on http://www.php.net/mysql_query :
> 
> " Only for SELECT,SHOW,EXPLAIN or DESCRIBE
> statements *mysql_query()* 
> returns a resource identifier or *FALSE* if the
> query was not executed 
> correctly. For other type of SQL statements,
> *mysql_query()* returns 
> *TRUE* on success and *FALSE* on error. A
> non-*FALSE* return value means 
> that the query was legal and could be executed by
> the server."
> 
> So ,  (false !== $result) means the query was
> sucessful , and if it was 
> successful (true === $result) would mean that no
> rows were returned.
> 
> Chris
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to