php-general Digest 16 Oct 2004 14:19:58 -0000 Issue 3056

Topics (messages 199622 through 199631):

php_printer functions, how to detect printer is ready to print out
        199622 by: CK
        199629 by: David Robley

Re: PHP 5.02 and Fedora Core 2 Installation question
        199623 by: Brad Pauly

Re: Problem with MSSQL
        199624 by: Yusuf Tikupadang

Best way to figure out whether a query returns RESULT or NON-RESULT
        199625 by: Karam Chand
        199626 by: Chris
        199628 by: Karam Chand
        199630 by: Marek Kilimajer

Regex help...
        199627 by: Murray . PlanetThoughtful

urlencode() and newlines?
        199631 by: Nick Wilson

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi.

I am currently working on a project that the script should print-out 
documents whenever local users wishe to print-out.

However, my concern is how to detect THE printer is ready to print out NOT 
only its driver is installed.

Thank you in advance.
CK 

--- End Message ---
--- Begin Message ---
On Sat, 16 Oct 2004 09:16, Ck wrote:

> Hi.
> 
> I am currently working on a project that the script should print-out
> documents whenever local users wishe to print-out.
> 
> However, my concern is how to detect THE printer is ready to print out NOT
> only its driver is installed.
> 
> Thank you in advance.
> CK

You'll need a client side application, such as Javascript, to handle that.


-- 
David Robley

I'd love to, but you know how we psychos are.

--- End Message ---
--- Begin Message ---
On Fri, 15 Oct 2004 10:49:27 -0600, Brad Pauly <[EMAIL PROTECTED]> wrote:
> 
> I am also trying to do this. Dovecot is the default IMAP server on
> FC2. I haven't had time to try it yet, but here is a link I found
> about compiling PHP with dovecot:
> 
> http://www.dovecot.org/list/dovecot/2004-July/004282.html

For anyone that is trying to compile 5.0.2 with imap support (dovecot)
on Fedora Core 2, the above link does the trick. At least it did for
me =)

Brad

--- End Message ---
--- Begin Message ---
Thanks, I will try it first


On Fri, 15 Oct 2004 09:26:21 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:
> http://pear.php.net/package/DB_Pager
> 
> --
> Greg Donald
> Zend Certified Engineer
> http://gdconsultants.com/
> http://destiney.com/

--- End Message ---
--- Begin Message ---
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.

>>>>>>>>>>>>>>>>>>>>>>

$result  = mysql_query ( $query, $mysql );

if ( !$result ) {
 HandleError ( mysql_errno(), mysql_error() );
 return;
}

if ( !mysql_num_rows ( $result ) && !mysql_num_fields
( $result ) )
{
// handle non_result values
return;
}

// handle result values

>>>>>>>>>>>>>>>>>>>>>>>> 

The problem is that if its an Update stmt. php throws
up an error that $result in mysql_num_rows() is not a
valid handle.

Moreover, from the manual - mysql_affected_rows() does
not work with SELECT statements; only on statements
which modify records. So to use it I have to figure
out if its a non-SELECT statement  

What you PHP gurus suggest the best way to handle such
situations?

Thanks in advance 

Regards,
Karam


                
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. 
http://messenger.yahoo.com

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message --- Karam Chand wrote:
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.

I Chris said, if($result === true || $result === false), no rows were returned.

--- End Message ---
--- Begin Message ---
Hi All,

 

I rather badly need some help with a regular expression.

 

I need to identify the occurrence of the following search string in another
string, and replace it with some text followed by the identified search
string.

 

<search string>

 

<p><a href="http://mysite/index.php?p=2#more-2";>(more&#8230;)</a></p>

 

</search string>

 

The consistent part of the string is the text "(more&#8230;)</a></p>"

 

Essentially, I'm trying to figure out how to insert text prior to the
opening "<p>" in this line.

 

Can anyone give me a hand in working this out?

 

Many thanks in advance!

 

Much warmth,

 

Murray


--- End Message ---
--- Begin Message ---
hello all, 

For reasons beyond my immediate control i have to keep some strings of
text in a text *new line delimited* text file. I also have to urlencode
those strings for use in my script.

Like this: 

## text file
This is a line\nThis is another line
This is another string\nwith some more\nnew lines

Problem is, that urlencoding those lines doesnt seem to work well the
the \n's - when they get to where they are going (another server, not in
my control) the new lines are no longer there...

Can anyone tell me how to get round this issue without storing the
strings in another way? - many thanks! ;-)
-- 
Nick W

--- End Message ---

Reply via email to