[PHP] SQLyog 3.51 Released

2003-06-30 Thread Karam Chand
SQLyog v3.51 - The definitive Windows Front End for
MySQL, has been released. 

SQLyog is a superfast, compact and easy to use Front
End for MySQL.

Some of the new features added in SQLyog 3.51 are - 

-- Complete support for MySQL 4.1.
-- Improved SQL Editor.
-- Improved ODBC Import Tool.
-- BLOB data does not require double click for viewing
if the data is < 255 bytes.
-- More compact and optimized executable ( 480 KB ). 
-- Lot of bugfixes and enhancements.

SQLyog 3.51 is available at an Introductory price of
$49.  

You can download a full featured Trial version of
SQLyog at http://www.webyog.com/sqlyog/download.html

Regards
Karam

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] SQLyog 2.51 - the definitve FREE Windows front-end to MySQL

2002-11-12 Thread Karam Chand
Greetings

SQLyog v2.51. The definitive Windows Front End for
MySQL. SQLyog is FREE!

Some of the new features added in SQLyog 2.51 are - 

-- Alter Table structure in an easy to use Grid mode.
-- Optimized for speed and network resources.
-- Insert / Update data in a table.
-- Insert / Update BLOB data. All popular formats
supported (BMP/PNG/GIF/JPG).
-- Save your BLOB data in a file.
-- Very fast client side sorting / filtering.
-- Create / Edit Users.
-- Manage permissions for Database / Table / Column.
-- View information for Database / Table.
-- Export database schema in HTML.
-- Execute very large ( size limited by OS ) SQL batch
files.
-- Export data in Fixed Width format.
-- View all queries executed in history log.
-- Various operations on tables.
-- Backup / Restore databases and tables.
-- Improved Export functionality.
-- Improved Import functionality.
-- Improved SQL Editor.
-- Show / Hide Result Pane.
-- Lot of bug fixes.
-- And many more...

You can download the new SQLyog at
http://www.webyog.com/sqlyog/download.html

Thanks for your attention.

Rgds
Karam


__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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




[PHP] PHP Journals and Magazined

2003-10-13 Thread Karam Chand
Hello

I just shifted to PHP from ASP and I am impressed. I
have a query though -

Apart from sites like phpbuilder.com etc. which is the
most read English magazines read by PHP developers. 

I know PHP Arch..nebody reading something
else...just querying...might subscribe to one of them.

Karam


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] Execute a linux binary that generates a registration code...

2003-12-04 Thread Karam Chand
Hello 

I have got an app wherein you need to pass a name as
the first parameter and it will output that is cout <<
a registraion code for my app based on the name. 

I would like to give a web based interface wherein a
user can give his name on the form and I will be able
to generate the code from PHP. 

I tried the commands - exec(), shell_exec() but none
seems to getting the output. 

in the shell i execute it as - ./appname "karam" 

the output is something like a223asas2323 ? How can i
get the output. 

any ideas.. 

thanks in advance.. 

Karam

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



[PHP] Not able to Linux binary

2003-12-04 Thread Karam Chand
Hello

I created a linux binary using GCC. Whenever you
execute it reads a file from the current directory and
outputs the contents. e.g. -

./myapp

output

hello world.

Now I want to execute it from php() so that I can
output the content on a HTML page or get the data in a
variable. Reading thru the manuals i came across
passtrhu() and exec().

I tried passthru

passthru("myapp");
and
passthru("./myapp");

but nothing is outputted. What is wronf?

myapp resides in the same directory as the
application. 

the page and the app is hosted at my ISP ( Interland )
server. the contents are -

/html/index.php
/html/myapp

Do I need to set up special permission?

Karam

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] Not able to Linux binary

2003-12-05 Thread Karam Chand
Hello

I am a astudent and my domain area is C++ I am and new
to PHP and all other scripting language. Couldnt hire
a PHP programmer coz of lack of funds :)

The program I wrote was just to learn how to execute a
binary from PHP. My actuall program takes a Name as
the first parameter and generates a registration code
for my software. I wanted a web based interface
wherein a user gives a Name and I can generate a Reg
Code for them and show it as output.

Therefore I do something like this -

./myapp "Karam"

output

a3fdgt567vcx75

Thats it. It only outputs the regcode and nothing
else. This is using some algorithm which is not
possible in PHP so cant use PHP out here :)

I have set the error reporting to full but nothing
happens. The PHP page loads up blank.

Ideally I should be doing something like this -

exec ( "myapp \"Karam\"");

and it should output the regcode?

I dont have any idea about safe mode. My PHP is loaded
up in my Host's server. Can I change the settings? If
yes then what should I do?

Thanks for your help.

Karam

--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Friday 05 December 2003 14:04, Karam Chand wrote:
> 
> > I created a linux binary using GCC. Whenever you
> > execute it reads a file from the current directory
> and
> > outputs the contents. e.g. -
> >
> > ./myapp
> >
> > output
> >
> > hello world.
> 
> If that is all it does, and that is all you need,
> why not implement it in PHP 
> code?
> 
> > Now I want to execute it from php() so that I can
> > output the content on a HTML page or get the data
> in a
> > variable. Reading thru the manuals i came across
> > passtrhu() and exec().
> >
> > I tried passthru
> >
> > passthru("myapp");
> > and
> > passthru("./myapp");
> >
> > but nothing is outputted. What is wronf?
> 
> 1) enable FULL error reporting
> 2) check safe mode settings
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Win98 is called Win98 because you need 98 MB RAM to
> install it.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] Not able to execute Linux binary

2003-12-05 Thread Karam Chand
Hello

The output is 

StartEnd 

I am sure that the linux binary is ok. coz if in the
sheel you just do

./myapp

it outputs 

error

seems that the binary is not getting executred. I
think there is some permission info.

if i do phpinfo() i get the following output for safe
stuff -

safe_mode Off Off 
safe_mode_exec_dir no value no value 
safe_mode_gid  Off Off 
safe_mode_include_dir no value no value 

Thanks for the help.

Karam

--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Friday 05 December 2003 20:43, Karam Chand wrote:
> 
> > I have set the error reporting to full but nothing
> > happens. The PHP page loads up blank.
> 
> Put the following lines at the top of your program:
> 
>   error_reporting (E_ALL);
>   ini_set('display_errors', 1);
> 
> That will force ALL errors to be displayed. Now do
> you see any errors?
> 
> Do you have any debugging code to confirm that your
> code is running? Eg:
> 
>   echo "Start";
>   exec ( "myapp \"Karam\"");
>   echo "End";
> 
> > I dont have any idea about safe mode. My PHP is
> loaded
> > up in my Host's server. Can I change the settings?
> If
> > yes then what should I do?
> 
> Before even contemplating changing the settings,
> read the relevant chapter in 
> the manual then check its current settings by using
> phpinfo().
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Your mode of life will be changed to EBCDIC.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] Not able to execute Linux binary

2003-12-05 Thread Karam Chand
Hello

looking at manuals and help and some help from you. i
wrote the attached code-

  error_reporting (E_ALL);
  ini_set('display_errors', 1);

  $result = `./myapp`;
  print_r ( $result );

  echo ( "2" );

  exec("./myapp",$result);
  print_r($result);

It is returning output

2Array ( ) 

which means the array is empty !!!

it should have outputted ErrorError

Both the php and the binary exsits in
http://www.mydomain.com/mgmt/

Can I send you the binary so that you can check it
out?

Karam

--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Saturday 06 December 2003 02:44, Karam Chand
> wrote:
> 
> > The output is
> >
> > StartEnd
> 
> Good, that shows your PHP program is being executed.
> 
> > I am sure that the linux binary is ok. coz if in
> the
> > sheel you just do
> >
> > ./myapp
> >
> > it outputs
> >
> > error
> >
> > seems that the binary is not getting executred. I
> > think there is some permission info.
> 
> Not necessarily. Now it's time to check the manual
> entry for exec() to see 
> what *exactly* that function does. You'll find that
> you're using it 
> incorrectly (or it doesn't do what *you* think it
> should do).
> 
> > if i do phpinfo() i get the following output for
> safe
> > stuff -
> >
> > safe_mode Off Off
> 
> Good, that rules out a lot of other possibilities as
> to why your program isn't 
> working.
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The doctrine of human equality reposes on this: that
> there is no man
> really clever who has not found that he is stupid.
>   -- Gilbert K. Chesterson
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] Not able to execute Linux binary

2003-12-07 Thread Karam Chand
Hello

I think there is some problem with the permission.
Even if I execute a command like -

echo ( "start" );
exec ( "pwd" );
echo ( "end" );

the output is - startend

shouldnt be pwd showing the present working directory
to me.

Karam
--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Saturday 06 December 2003 12:56, Karam Chand
> wrote:
> 
> > looking at manuals and help and some help from
> you. i
> > wrote the attached code-
> >
> >   error_reporting (E_ALL);
> >   ini_set('display_errors', 1);
> >
> >   $result = `./myapp`;
> >   print_r ( $result );
> >
> >   echo ( "2" );
> >
> >   exec("./myapp",$result);
> >   print_r($result);
> >
> > It is returning output
> >
> > 2Array ( )
> >
> > which means the array is empty !!!
> >
> > it should have outputted ErrorError
> 
> I believe you mean to say that it should output:
> 2Error
> 
> OK, does your "myapp" program dump its output to
> STDOUT?, Remember exec() only 
> captures STDOUT.
> 
> > Both the php and the binary exsits in
> > http://www.mydomain.com/mgmt/
> 
> One way to satisfy yourself that exec() is working
> is to create a small test 
> program, eg:
> 
> 8<-
> #!/bin/bash
> echo "test"
> 8<-
> 
> Then exec() it.
> 
> > Can I send you the binary so that you can check it
> > out?
> 
> No thank you.
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The girl who stoops to conquer usually wears a
> low-cut dress.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



[PHP] PHP code documentation tool

2004-01-08 Thread Karam Chand
Hello

I recently got a fairly big project in PHP. Before
starting I would like to clear some doubts.

What is the best way to document such projects? How
you developers document your project?

For .NET etc. there are many documentation tools like
doc-o-matic etc.

Do we need to document the code based on rules for
such software...or you create your own PHP script to
extract comments?

Is there any tool like doc-o-matic for PHP or anybody
developing something like that?

Karam

__
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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



[PHP] Server Error : Premature end of script headers: php-engine

2004-08-24 Thread Karam Chand
Hello,

I have a fairly big table of 60K rows with 9 cols. 

I have a C++ app that connects to a PHP page. This PHP
page in turn connects to the above table and outputs
all the row in form of XML. I get all this data in my
C++ app, parse it with an XML parser and do my work.
My PHP source looks something like:

$numrows = mysql_num_rows ( $result );
echo "";
while ( $row = mysql_fetch_array ( $result ) )
{
 $lengths = mysql_fetch_lengths ( $result );
 echo "";
 for ( $i=0; $i < $fieldcount; $i++ )  {
  echo "";
  if ( !isset($row[$i]) /*== NULL*/ )   {
   echo "(NULL)";  }
  else   {
   if ( mysql_field_type ( $result, $i ) == "blob" ) 
   {if ( $lengths[$i] == 0 ) 
{ echo "_";}
else{
 echo convertxmlchars ( base64_encode ( $row[$i] )
);
}   }   else
   {if ( $lengths[$i] == 0 ) 
{ echo "_";}
else{
 echo convertxmlchars($row[$i]); }  }  }
  echo ""; } echo "";}
echo "";

Now for this table the server is always throwing up
the above error. The server is running 4.1.2 on Linux.
Actually its my ISP configuration.

I have a replica of the same table in my localhost
machine running IIS/PHP 4.1.2. I never get this error.
It might because I am in the same machine but why the
error throwing up from my ISP machine?

I checked the memory_limit value of both my localhost
and ISP. They are both 8M, but the dump works from
localhost PHP but not ISP. Since I have full control
over my localhost PHP settings, i changed the
memory_limit to 1M in php.ini and reexecuted the
process from my C app. Bingo it still works. But not
unde 8m limit of my ISP. 

Also my ISP had max_execution_time of 30secs and my
localhost had 300secs. So I changed my local php.ini
and converted the value to 30sec. Still the process
gets over in my local machine.

So I went ahead and made the value to be 5sec. But now
in my local machine the script gets stopped after some
time and it echoes half the XML. Since the elements
start/end pair are not correct my XML parser throws up
the error.

Now both the system atleast throws up error but the
error are not same. With my ISP i get - Premature end
of script headers and on my local the server echoes
half the information and dies.

Sorry for the long post but I have tried to give as
much description as possible.

Regards,
Karam





__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] Server Error : Premature end of script headers: php-engine

2004-08-24 Thread Karam Chand
Hello,

Connecting to the PHP using Windows WinInet APIs. Mine
is a C++ app that connects to the PHP and gets data.

The above probcess works like a cheese for tables upto
10-20K but when I put on more heavy load like the
table described, WinInetAPI returns with the following
error.

Regards,
Karam

--- Curt Zirzow <[EMAIL PROTECTED]> wrote:

> * Thus wrote Karam Chand:
> > Hello,
> > 
> > I have a fairly big table of 60K rows with 9 cols.
> 
> > 
> > I have a C++ app that connects to a PHP page. This
> PHP
> > page in turn connects to the above table and
> outputs
> > all the row in form of XML. I get all this data in
> my
> > C++ app, parse it with an XML parser and do my
> work.
> > My PHP source looks something like:
> 
> Connection to a PHP page how?  The Premature end of
> script headers
> error is usually due to a cgi-script not sending the
> right headers
> which minimally is:
> 
>   HTTP/1.x 200 OK
>   Content-Type: type/ofcontent
> 
> ...data
> 
> 
> If you dont get that first line back (the status
> line) then you
> will most likely get that error.
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of
> those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is
> the trapezoid!
> 
> -- 
> 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



Re: [PHP] Server Error : Premature end of script headers: php-engine

2004-08-24 Thread Karam Chand
Hi,

Thanks for your continued help. Even I was wondering
the same problem.

So I went ahead to look into the ini settings. My
local memory limit is 8M as well as the ISP one. The
timeout for my local PHP is 300 secs and timeout for
my ISP is 30 secs. 

Even if I try to reduce my local timeout value to a
very small value the script dosnt seem to break and
the ouput comes correctly. The problem only happens
when I connect to my ISP server i.e. a remote server.

I think that this is a MEMORU overshoot problem as lot
of other users also use the same ISP machine for their
PHP work so I guess all combined work crosses the
memory limit.

Regards,
Ritesh

--- Curt Zirzow <[EMAIL PROTECTED]> wrote:

> * Thus wrote Karam Chand:
> > Hello,
> > 
> > Connecting to the PHP using Windows WinInet APIs.
> Mine
> > is a C++ app that connects to the PHP and gets
> data.
> > 
> > The above probcess works like a cheese for tables
> upto
> > 10-20K but when I put on more heavy load like the
> > table described, WinInetAPI returns with the
> following
> > error.
> 
> ah.. this sounds like php is probably running out of
> memory. See
> php.ini setting 'memory_limit'. It could also be an
> issue with
> 'max_execution_time' as well.
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of
> those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is
> the trapezoid!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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



[PHP] Time consumed in microseconds

2004-08-30 Thread Karam Chand
Hello,

In Win32 API to profile a job we use the following
method:


 timetaken = GetTickCount();
 /* do some job */
 timetaken = GetTickCount() - timetaken;

In this way timetaken returns you the time taken by
the job to complete?

How can I get it in PHP. I want the exact figure in
ms? I used microtime() and the samples given in
php.net but none of them correctly returns the
difference only in ms?
 
Regards,
Karam   




___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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



Re: [PHP] Time consumed in microseconds

2004-08-30 Thread Karam Chand
Darn missed it. Looking into the docs I am using code
somthing like this:

$start   = microtime();
$result  = mysql_query ( $query, $mysql );
$end = microtime();

$diff   =  microtime_diff ($start, $end);

function microtimdiff() is given by:

function microtime_diff($a, $b)
{
   list($a_dec, $a_sec) = explode(" ", $a);
   list($b_dec, $b_sec) = explode(" ", $b);

   return ((float)$b_sec - (float)$a_sec +
(float)$b_dec - (float)$a_dec);
}

The result from one operation is like:

$start = 0.26562800 1093931165
$end = 0.26813400 1093931165
$diff = 0.002506

So to get the difference in ms I have to multilply
$diff by 1000. 

Am I correct?

Regards,
Karam

--- John Holmes <[EMAIL PROTECTED]> wrote:

> Karam Chand wrote:
> > In Win32 API to profile a job we use the following
> > method:
> > 
> > 
> >  timetaken = GetTickCount();
> >  /* do some job */
> >  timetaken = GetTickCount() - timetaken;
> > 
> > In this way timetaken returns you the time taken
> by
> > the job to complete?
> > 
> > How can I get it in PHP. I want the exact figure
> in
> > ms? I used microtime() and the samples given in
> > php.net but none of them correctly returns the
> > difference only in ms?
> 
> Read the manual page again. Use the example to get
> the microtime as a 
> float at the start and then after your job. Subtract
> to get the 
> difference. If you're using PHP5, just use
> microtime(TRUE); to get the 
> float value.
> 
> -- 
> 
> ---John Holmes...
> 
> Amazon Wishlist:
> www.amazon.com/o/registry/3BEXC84AB3A5E/
> 
> php|architect: The Magazine for PHP Professionals –
> www.phparch.com
> 
> 
> 


__
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



[PHP] Best way to figure out whether a query returns RESULT or NON-RESULT

2004-10-15 Thread Karam Chand
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

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



Re: [PHP] Best way to figure out whether a query returns RESULT or NON-RESULT

2004-10-16 Thread Karam Chand
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



Re: [PHP] Best way to figure out whether a query returns RESULT or NON-RESULT

2004-10-16 Thread Karam Chand
Thanks.

Never knew there existed (===). Silly me :)

Regards,
Karam

--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:

> 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.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



[PHP] Webyog releases SQLyog 3.71 & SJA 2.0

2004-06-09 Thread Karam Chand
Webyog has released SQLyog 3.71 & SQLyog Job Agent (
SJA ) v2.0

Some of the major features added in SQLyog 3.71 are - 

-- SQLyog Notification Services - This new feature
allows delivery of formatted resultset(s) over email
at scheduled intervals.
-- SQLyog Database Synchronization Tool now supports
2-way synchronization. 
-- Now you can execute SJA jobs from SQLyog using
Tools -> Job Manager. 
-- Improved Online Help.
-- Fully compatible with MySQL versions 3.23.58 to
5.x. 

You can download a full featured Trial version of
SQLyog at http://www.webyog.com/sqlyog/download.html

Regards,
Karam




__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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



[PHP] MySQL/PHP Tunneling

2004-07-10 Thread Karam Chand
Hello,

Recently lot of MySQL clients try to overcome host
based privilege system of MySQL by using PHP tunneling
method.

In this method they call up a PHP file in the server
and the PHP file executes a query and sends the data
in XML format. 

I am using C API() and I was just wondering if
somebody is working on such tunnels i.e. a PHP file
and its corresponding C/++ code that will fill up
MYSQL_RES structures correctly so that I can use them
to C API() without any problem. Otherwise, i guess i
have to write one for myself.

Regards,
Karam




__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: [PHP] MySQL/PHP Tunneling

2004-07-10 Thread Karam Chand
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> 
> First off, when starting a new topic, don't reply to
> message and
> then change the topic.

Sorry. But I just didnt remember the email addy so I
took that way :).

> 
> * Thus wrote Karam Chand:
> > Hello,
> > 
> > Recently lot of MySQL clients try to overcome host
> > based privilege system of MySQL by using PHP
> tunneling
> > method.
> > 
> > In this method they call up a PHP file in the
> server
> > and the PHP file executes a query and sends the
> data
> > in XML format. 
> 
> This doesn't really explain much.
> 

Try out www.mysqlfront.de (docs should be enough i
guess :) ). Its a GUI for MySQL. It has an option for
PHP tunneling and this is what I am refering to.

Now, many of the ISPs blokc 3306 for security reason
and you cannot access MySQL from a 3rd party tool and
have to use phpMyAdmin which is able to access the
MySQL server as it is running on the same box.
Sometimes, SSH tunneling is also not the option :)

Most of these tools use MySQL C API() or some sort of
wrapper for it to connnect to the server and do their
job. Instead of connecting directly to the server
using:

mysql_real_connect (  ). 

They callup the above mentioned PHP file and pass the
query as a argument. The PHP file then connects to the
local mysql server,executes the query and returns all
the required data as XML or a pre-determined format.
In the client side the app again assembles this data
and fills up MYSQL_RES* structure, the main structure
in C API() to work with resultsets. 

In short this is what happens:

/*

  connect to the php file using your C prog.
  e.g. http://somehost.com/some.php?query=select *
from sometable

  the PHP file then executes the query and writes the
result as XML (for e.g.).

  

 aaa
 asasas
 ...


   

   

   in the client side the app fills creates and fills
up the MYSQL_RES sturcture with this data and then use
various APIs like:

   mysql_fetch_row()
   mysql_fetch_fields()

*/

So basically instead of working on raw sockets and
using MySQL protocol to fill up the required
sturctures, they make a bridge between HTTP - MySQL
protocol.

So I just wanted to know if somebody has written a
generic library like this? Otherwise, I guess I have
to write one for my app.

Regards,
Karam  
 
> > 
> > I am using C API() and I was just wondering if
> > somebody is working on such tunnels i.e. a PHP
> file
> > and its corresponding C/++ code that will fill up
> > MYSQL_RES structures correctly so that I can use
> them
> > to C API() without any problem. Otherwise, i guess
> i
> > have to write one for myself.
> 
> Now, I'm utterly confused. I have no idea what
> you're referring to
> as C API() nor php tunneling.
> 
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of
> those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is
> the trapezoid!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




__
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] MySQL/PHP Tunneling

2004-07-11 Thread Karam Chand
Hello,

Well, I know there are issues regarding this (security
as well as others). But tools like MySQL-Front and
DBTools are just doing that and it just happens that
the project i am working on needed something like
that, so I was just asking :)

Regards,
Karam
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> * Thus wrote Karam Chand:
> > --- Curt Zirzow <[EMAIL PROTECTED]>
> wrote:
> > 
> > Now, many of the ISPs blokc 3306 for security
> reason
> > and you cannot access MySQL from a 3rd party tool
> and
> > have to use phpMyAdmin which is able to access the
> > MySQL server as it is running on the same box.
> > Sometimes, SSH tunneling is also not the option :)
> 
> There usually is a reason why the port 3306 port is
> blocked or that
> mysql simply doesn't listen to outside addresses on
> that port.  By
> trying to circumstant that will probably result in a
> violation of
> their TOS.
> 
> And as Jason suggested, use an ISP that either
> supports ssh
> tunneling (which is preferred and more likely to
> occur) or find a
> ISP that allows port 3336 to the open world.
> 
> What you describe is more in the lines of Proxying,
> which is
> probably why I was confused.  And I wouldn't suggest
> to anyone to
> do that kind of proxying, the layers between
> everything can be
> *very* unstable.
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of
> those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is
> the trapezoid!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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