Re: [PHP] Urgent help - Token Generation code!

2011-05-28 Thread Shreyas Agasthya

Let me try and get back.

Thanks, Jasper!



On 28-May-2011, at 4:29 AM, Jasper Mulder   
wrote:






From: shreya...@gmail.com
To: lord_fa...@hotmail.com
Subject: Re: [PHP] Urgent help - Token Generation code!
Date: Sat, 28 May 2011 04:15:59 +0530

Jasper,

Tried echoing $sToken but wouldn't work.

Regards,
Shreyas

On 28-May-2011, at 4:11 AM, Jasper Mulder
wrote:





Date: Sat, 28 May 2011 03:56:26 +0530
From: shreya...@gmail.com
To: php-general@lists.php.net
Subject: [PHP] Urgent help - Token Generation code!

I am re-visiting the world of PHP after a really big hiatus and I
am finding
things veryslippery. Can someone please help me with the below code
and let
me know how I can print the token that is getting generated?

I am using EasyPHP and I am trying to echo the $token but it
wouldn't print
anything. I am trying it as : http://localhost/token/URLToken.php.
May I
know where all I am going wrong here in my approach?




$sUrl = "/tstd_c_b1@s54782";
$sParam = "primaryToken";
$nTime = time();
$nEventDuration = 86400;
$nWindow = $nTime + $nEventDuration;
$sSalt = "akamai123!";
$sExtract = ""; // optional



As a second try, what happens if you add right here the line

$sGen = urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract,  
$nTime);


Because it seems as though you just declare three functions in the  
code

without calling them...



function urlauth_gen_url($sUrl, $sParam, $nWindow,
$sSalt, $sExtract, $nTime) {



$sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt,
$sExtract, $nTime);
echo $token;


There are two cases:
1. You made a typo and meant 'echo $sToken;' on the above line  
instead

2. You omitted the part where $token is defined and used


[More code that seemed fine]

--
Regards,
Shreyas Agasthya




Best regards,
Jasper Mulder



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



RE: [PHP] Urgent help - Token Generation code!

2011-05-27 Thread Jasper Mulder


> From: shreya...@gmail.com
> To: lord_fa...@hotmail.com
> Subject: Re: [PHP] Urgent help - Token Generation code!
> Date: Sat, 28 May 2011 04:15:59 +0530
>
> Jasper,
>
> Tried echoing $sToken but wouldn't work.
>
> Regards,
> Shreyas
>
> On 28-May-2011, at 4:11 AM, Jasper Mulder 
> wrote:
>
> >
> > 
> >> Date: Sat, 28 May 2011 03:56:26 +0530
> >> From: shreya...@gmail.com
> >> To: php-general@lists.php.net
> >> Subject: [PHP] Urgent help - Token Generation code!
> >>
> >> I am re-visiting the world of PHP after a really big hiatus and I
> >> am finding
> >> things veryslippery. Can someone please help me with the below code
> >> and let
> >> me know how I can print the token that is getting generated?
> >>
> >> I am using EasyPHP and I am trying to echo the $token but it
> >> wouldn't print
> >> anything. I am trying it as : http://localhost/token/URLToken.php.
> >> May I
> >> know where all I am going wrong here in my approach?
> >>
> >>>
> >> $sUrl = "/tstd_c_b1@s54782";
> >> $sParam = "primaryToken";
> >> $nTime = time();
> >> $nEventDuration = 86400;
> >> $nWindow = $nTime + $nEventDuration;
> >> $sSalt = "akamai123!";
> >> $sExtract = ""; // optional
> >>

As a second try, what happens if you add right here the line

$sGen = urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime);

Because it seems as though you just declare three functions in the code
without calling them...

> >>
> >> function urlauth_gen_url($sUrl, $sParam, $nWindow,
> >> $sSalt, $sExtract, $nTime) {
> >>
> >>
> >>
> >> $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt,
> >> $sExtract, $nTime);
> >> echo $token;
> >
> > There are two cases:
> > 1. You made a typo and meant 'echo $sToken;' on the above line instead
> > 2. You omitted the part where $token is defined and used
> >
> >> [More code that seemed fine]
> >>
> >> --
> >> Regards,
> >> Shreyas Agasthya
> >

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



RE: [PHP] Urgent help - Token Generation code!

2011-05-27 Thread Jasper Mulder


> From: lord_fa...@hotmail.com
> To: shreya...@gmail.com
> Subject: RE: [PHP] Urgent help - Token Generation code!
> Date: Sat, 28 May 2011 00:41:02 +0200
>
>
> 
> > Date: Sat, 28 May 2011 03:56:26 +0530
> > From: shreya...@gmail.com
> > To: php-general@lists.php.net
> > Subject: [PHP] Urgent help - Token Generation code!
> >
> > I am re-visiting the world of PHP after a really big hiatus and I am finding
> > things veryslippery. Can someone please help me with the below code and let
> > me know how I can print the token that is getting generated?
> >
> > I am using EasyPHP and I am trying to echo the $token but it wouldn't print
> > anything. I am trying it as : http://localhost/token/URLToken.php. May I
> > know where all I am going wrong here in my approach?
> >
> > >
> > $sUrl = "/tstd_c_b1@s54782";
> > $sParam = "primaryToken";
> > $nTime = time();
> > $nEventDuration = 86400;
> > $nWindow = $nTime + $nEventDuration;
> > $sSalt = "akamai123!";
> > $sExtract = ""; // optional
> >
> >
> > function urlauth_gen_url($sUrl, $sParam, $nWindow,
> > $sSalt, $sExtract, $nTime) {
> >
> >
> >
> > $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt,
> > $sExtract, $nTime);
> > echo $token;
>
> There are two cases:
> 1. You made a typo and meant 'echo $sToken;' on the above line instead
> 2. You omitted the part where $token is defined and used
>
> > [More code that seemed fine]
> >
> > --
> > Regards,
> > Shreyas Agasthya
>
> Best regards,
> Jasper Mulder
>

I forgot to hit Reply All instead of Reply.
I am deeply sorry for such a careless omission.

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



[PHP] Urgent help - Token Generation code!

2011-05-27 Thread Shreyas Agasthya
I am re-visiting the world of PHP after a really big hiatus and I am finding
things veryslippery. Can someone please help me with the below code and let
me know how I can print the token that is getting generated?

I am using EasyPHP and I am trying to echo the $token but it wouldn't print
anything. I am trying it as : http://localhost/token/URLToken.php. May I
know where all I am going wrong here in my approach?

 12)) {
return;
}

if (($nWindow < 0) || (!is_integer($nWindow))) {
return;
}

if (($nTime <= 0) || (!is_integer($nTime))) {
$nTime = time();
}

$nExpires = $nWindow + $nTime;

if (strpos($sUrl, "?") === false) {
$res = $sUrl . "?" . $sParam . "=" . $nExpires . "_" . $sToken;
} else {
$res = $sUrl . "&" . $sParam . "=" . $nExpires . "_" . $sToken;
}

return $res;
}

/**
 * Returns the hash portion of the token. This function should not be
 *   called directly.
 */
function urlauth_gen_token($sUrl, $nWindow, $sSalt,
   $sExtract, $nTime) {


if (($sUrl == "") || (!is_string($sUrl))) {
return;
}

if (($nWindow < 0) || (!is_integer($nWindow))) {
return;
}

if (($sSalt == "") || (!is_string($sSalt))) {
return;
}

if (!is_string($sExtract)) {
$sExtract = "";
}

if (($nTime <= 0) || (!is_integer($nTime))) {
$nTime = time();
}

$nExpires = $nWindow + $nTime;
$sExpByte1 = chr($nExpires & 0xff);
$sExpByte2 = chr(($nExpires >> 8) & 0xff);
$sExpByte3 = chr(($nExpires >> 16) & 0xff);
$sExpByte4 = chr(($nExpires >> 24) & 0xff);

$sData = $sExpByte1 . $sExpByte2 . $sExpByte3 . $sExpByte4
 . $sUrl . $sExtract . $sSalt;

$sHash = _unHex(md5($sData));

$sToken = md5($sSalt . $sHash);
return $sToken;
}

/**
 * Helper function used to translate hex data to binary
 */
function _unHex($str) {
$res = "";
for ($i = 0; $i < strlen($str); $i += 2) {
$res .= chr(hexdec(substr($str, $i, 2)));
}
return $res;
}

?>

-- 
Regards,
Shreyas Agasthya


Re: [PHP] Urgent Help Needed

2007-09-15 Thread Stut

vingupta3 wrote:

  Its been a whiling i am searching for "Sync Outlook
with MySQL via PHP". 


I want to synchronize Calendar events and Contacts
from Outlook with MySQL via PHP. 


Can you help me with it..


http://php.net/com

Here endeth the PHP involvement. Look up the Outlook COM objects in the 
MSDN documentation for help with those.



a very thanks in advance!


A very you're welcome on time.

-Stut

--
http://stut.net/

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



[PHP] Urgent Help Needed

2007-09-15 Thread vingupta3
Hi,
  Its been a whiling i am searching for "Sync Outlook
with MySQL via PHP". 

I want to synchronize Calendar events and Contacts
from Outlook with MySQL via PHP. 

Can you help me with it..

a very thanks in advance!


~Vinay



   

Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

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



Re: [PHP] Urgent Help

2003-09-26 Thread Jason Sheets
Hello Ho,

If you are using a printer that is postscript enabled (like HP
LaserJet's) it is easy. Simply convert whatever you want to print to a
postscript file (there are several utilities on freshmeat.net they do
this) and then using PHP open a socket to the JetDirect card and send
the data. HP's JetDirect port is 9100. You could possibly install LPR or
CUPS on your PHP server and use the printer that way as well.

Jason

ho anson wrote:

>Hello, my name is anson, I am a year 2 student in Hong
>Kong Ive. I have decided to do a final year project by
>using php to make a wireless ordering system for
>restaurants. In my project, I decide to use php
>scripts to sent the order content or some information
>to different printers. I have 3 printers with differet
>Ip address. My question is can I use php script to
>send information to an intended IP printer? If it can
>be achieved, then what command I should use? or is
>there any example I can find in php.net?
>
> 
>I am looking forward to hearing from you reply.
>Thanks for your kind attention 
>
>=
>Ho King Man,
>Anson
>
>_
>最新鈴聲推介:[EMAIL PROTECTED]
>http://ringtone.yahoo.com.hk
>
>  
>

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



[PHP] Urgent Help

2003-09-26 Thread ho anson
Hello, my name is anson, I am a year 2 student in Hong
Kong Ive. I have decided to do a final year project by
using php to make a wireless ordering system for
restaurants. In my project, I decide to use php
scripts to sent the order content or some information
to different printers. I have 3 printers with differet
Ip address. My question is can I use php script to
send information to an intended IP printer? If it can
be achieved, then what command I should use? or is
there any example I can find in php.net?

 
I am looking forward to hearing from you reply.
Thanks for your kind attention 

=
Ho King Man,
Anson

_
最新鈴聲推介:[EMAIL PROTECTED]
http://ringtone.yahoo.com.hk

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



RE: [PHP] Urgent help required for using Cron

2003-08-29 Thread Javier Tacon

It seems problems with permissions.

Can you pass me the output from "ls -la /var/spool/cron/"

May be exists a directory called root inside /var/spool/cron, so, if exists, you 
should delete it and try again.



-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 29 de agosto de 2003 3:37
Para: PHP General; Javier Tacon
CC: Bimal Jain
Asunto: RE: [PHP] Urgent help required for using Cron


Dear Javier,

We have done the following as per your suggestion
15 17 * * *   /path/to/your/php/binary  /path/to/your/script.php
After editing and saving crontab file the following message pops up at the
commond prompt -
crontab:installing new crontab
crontab:error renaming cron/tmp.1885 to cron/root
rename: is a directory
crontab: edit left in /tmp/crontab.1885

It did not work.  Please suggest what to do next?

Regards

Siva
-Original Message-
From: Javier Tacon [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 5:17 PM
To: Safal Solutions
Subject: RE: [PHP] Urgent help required for using Cron



For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it
doesn't say if your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your
script.
You can use a some mail classes that they have debug options (for example I
use phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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

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



RE: [PHP] Urgent help required for using Cron

2003-08-29 Thread Safal Solutions
Dear Javier,

We have done the following as per your suggestion
15 17 * * *   /path/to/your/php/binary  /path/to/your/script.php
After editing and saving crontab file the following message pops up at the
commond prompt -
crontab:installing new crontab
crontab:error renaming cron/tmp.1885 to cron/root
rename: is a directory
crontab: edit left in /tmp/crontab.1885

It did not work.  Please suggest what to do next?

Regards

Siva
-Original Message-
From: Javier Tacon [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 5:17 PM
To: Safal Solutions
Subject: RE: [PHP] Urgent help required for using Cron



For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it
doesn't say if your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your
script.
You can use a some mail classes that they have debug options (for example I
use phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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

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



RE: [PHP] Urgent help required for using Cron

2003-08-28 Thread Javier Tacon
For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it doesn't say if 
your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your script.
You can use a some mail classes that they have debug options (for example I use 
phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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

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



RE: [PHP] Urgent help required for using Cron

2003-08-28 Thread Jay Blanchard
[snip]
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time
using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a
message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the
mail
we want Cron to indicate to us that the mail was successfully sent or
not
sent.  This we want to know through a program because we want to use
this as
a part of automation of sending mails.
[/snip]

Did you have a look at the tutorial I sent you?
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
What, specifically, do you not understand?

1. From the command line type "crontab -e". This brings up the cron list
in vi
2. type "i" for the insert command
3. on the last line type the time you would like the cron to run, along
with commands

15 3 * * * /usr/local/bin/php /path/to/my/mail_script.php

will run the PHP script each morning at 3:15 AM

4. Hit 'escape' and type :w! to save
5. type :q! to quit

The cron job will now run each morning at 3:15 AM

HTH!

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



Re: [PHP] Urgent help required for using Cron

2003-08-28 Thread [EMAIL PROTECTED]
Hi

briefly: you need to create a cron job by typing crontab -e at the 
command line.
each line in the crontab has five fields which define the time at which 
the cron job will run.
more info in man cron and man crontab.

Cron sends a mail to the owner of the job when a job fails. you can pipe 
it to a program (this has been discussed extensively in this group this 
week so i will not go into details)

all the best

Safal Solutions wrote:

Hi friends,
 I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.
I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.
Thanking you,

Siva

 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Urgent help required for using Cron

2003-08-28 Thread Safal Solutions
Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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



Re: [PHP] Urgent Help Needed removing \n\r

2003-02-14 Thread Ernest E Vogelsinger
At 23:12 14.02.2003, Daniel Negron/KBE said:
[snip]
>have run into a problem now, that every page I have edited has somehow
>corrupted most/all of the  and  tags.  so they look like  this
>
>  face="ARIAL, HELVETICA">
>
>Now when the page is read it actually prints out "" instead of changing the font or showing the IMAGE.  The font I
[snip] 

There must be a different problem since the tag is perfectly valid, even
with the spaces/newlines you are showing. If it prints our the HTML tags
have a look at the source if they didn't get encoded somehow (like )


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] Urgent Help Needed removing \n\r

Hi all,

Slight problem, I have about 200 pages of HTML stored in a mysqlDB.  I had
to manually edit some information on EVERY single page.  I used MySQL-Front
and edited these pages.  All of the tags were correct  and  I
have run into a problem now, that every page I have edited has somehow
corrupted most/all of the  and  tags.  so they look like  this



Now when the page is read it actually prints out "" instead of changing the font or showing the IMAGE.  The font I
am not so much worried about it is the image that is not showing up and the
there are too many pages to go through manually.

Can someone help me with a PHP script to go through the db and replace the
\n\r ?


Thank you,


---
-Daniel Negron

  // \\*
 /  _  __ ___  \Lotus Notes Admin / Developer
|  | |/ /| _ )  |   KB Electronic, Inc.
|  | ' < | _ \  |   12095 NW 39th Street
|  |_|\ \|___/  |   Coral Springs, FL. 33065
 \ \_\ /954.346.4900 x 122
  \\ // email: [EMAIL PROTECTED]

-   http://www.kbelectronics.com
---



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




RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

Hey Vern,

PHP does not think you have the MySQL module installed. none of the mysql_*
commands are going to work. check the output of phpinfo() to verify. What
version of PHP are you running? Since you are using RPMs the only (helpful)
advice I can give is try re-installing the PHP rpm. Possibly it needs to
refresh itself. (I can offer some unhelpful advice like quit using RPMs and
compile from source...switch to gentoo linux instead of RedHat for a better
package manager...you know, stuff like that. But that's not helpful at the
moment!)  :)

=C=


* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com


-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 6:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2


After upgrading to MySQL 4.0.1.2 I ma getting the message :

Fatal error: Call to undefined function: mysql_connect() in
/home/penpals/pub/mysql.php on line 3

Please help my production server is down!



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



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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

On Thursday 13 February 2003 20:42, Vernon wrote:
> This is not helping me. I know very well that I should not and I tried the
> upgrade on two other machines and all went wll.
>
> My problem still stands and a search does ntohiong but tell me to check
> that the path is correct. If it worked before then obviously the path is
> fine, unless something has changed.
>
> Please I need help getting this thing up now.

archives > Call to undefined function mysql_connect()

-- 
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
--
/*
With clothes the new are best, with friends the old are best.
*/


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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

For some reason I do not see any error logs for today.



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




RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

> -Original Message-
>  If it worked before then obviously the path is fine,
> unless something has changed.

Obviously something changed if it worked on 2 other servers. Check all your
logs.


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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

What are apache logs telling you?

Vernon wrote:


After upgrading to MySQL 4.0.1.2 I ma getting the message :

Fatal error: Call to undefined function: mysql_connect() in
/home/penpals/pub/mysql.php on line 3

Please help my production server is down!



 



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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

This is not helping me. I know very well that I should not and I tried the
upgrade on two other machines and all went wll.

My problem still stands and a search does ntohiong but tell me to check that
the path is correct. If it worked before then obviously the path is fine,
unless something has changed.

Please I need help getting this thing up now.



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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

On Thursday 13 February 2003 20:12, Vernon wrote:
> After upgrading to MySQL 4.0.1.2 I ma getting the message :
>
> Fatal error: Call to undefined function: mysql_connect() in

Search archive on the above.

> Please help my production server is down!

If it's critical shouldn't you test all upgrades on a development server 
before rolling out onto the production server?

-- 
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
--
/*
There never was a good war or a bad peace.
-- B. Franklin
*/


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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

Yes



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




Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

This one time, at band camp,
"Vernon" <[EMAIL PROTECTED]> wrote:

> After upgrading to MySQL 4.0.1.2 I ma getting the message :
> 
> Fatal error: Call to undefined function: mysql_connect() in
> /home/penpals/pub/mysql.php on line 3

hmm, did you install from RPM??

Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




[PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

After upgrading to MySQL 4.0.1.2 I ma getting the message :

Fatal error: Call to undefined function: mysql_connect() in
/home/penpals/pub/mysql.php on line 3

Please help my production server is down!



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




[PHP] Urgent help with Sessions and Cookies


I have a very, very little site for a client, I have to set a username and 
password to admin some data they publish, the problem is that in my server 
the cookies and sessions work excellent, but when I publish the same code 
in my client's server it doesn't work, the cookie is deleted immediately, 
and sessions dissapear too, I have other sections in the same server using 
cookies and session and work fine, but in this specific directory it 
doesn't work.

Any idea???


Jadiel Flores
-
http://www.abargon.com
[EMAIL PROTECTED]
(52-55) 52-29-80-34



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




[PHP] URGENT-HELP !!!!!!




Hi All,

   Thanks very much for all who suggested ways to 

help me out. I sthere any better way of doing this 

[ please read the following ] using some code in PHP.

Regards,

Kumar.
On Fri, 30 Nov 2001 Chamarty Prasanna Kumar wrote :
> 
> 
> Hi,
> 
>Want to send "mail" through PHP script such that
> 
> the receiver of that mail should not contain FROM
> 
> header.
> 
> I used mail() function with empty FROM header and
> 
> even without FROM header, but the receiver is still
> 
> getting FROM address as [EMAIL PROTECTED]
> 
> 
> 
> Anyone can help 
> 
> 
> Thanks in advance,
> 
> Kumar. 
> 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] URGENT-HELP !!!!!!



If you mail via pfsockopen, then you specify the sender which must be 
real, but you also specify the From: header which can be anything you 
want.

ex:

$smtp_server = "your.smtp.server";
$port = 25;
$mydomain = "yourdomain.com";
$sender = "[EMAIL PROTECTED]";
$recipient = "[EMAIL PROTECTED]";
$subject = "Test";

$text_content = "Hi Bar, This is a test.";

$handle = fsockopen("$smtp_server","$port");
fputs($handle, "HELO $mydomain\n");
fputs($handle, "MAIL FROM: $sender \n");
$echo .=  fgets($handle,255)."\n";
fputs($handle, "RCPT TO: $recipient \n");
$echo .=  fgets($handle,255)."\n";
fputs($handle, "DATA\n");
$echo .= fgets($handle,255)."\n";
fputs($handle, "To: $recipient\n");

/* NOTE THAT HERE YOU SET WHAT APPEARS IN THE FROM: PART */

fputs($handle, "From: \n");


fputs($handle, "Subject: $email_subject\n");
fputs($handle, "Content-Type: text/plain; \n");

fputs($handle, $text_content."\n\n");

fputs($handle, ".\n");

$echo .= fgets($handle,255)."\n";

fputs($handle, "QUIT\n");

$echo .= fgets($handle,255)."\n";

echo "$echo";

Works here, but results may vary.


>>I am talking about the final SMTP host.. it will do a reverse lookup on the
>>From: domain and if it dont resolve to the IP of the sending STMP host it
>>will reject it.
>>
>yes I know. But it the final SMTP tries to resolve the host 
>(localhost) it will get a response from it self? I haven't tried it, 
>but I think it would work.
>
>By the way... the most of the SMTP doesn't check at the FROM header, 
>but from the sender SMTP.
>So if you got a nonexisting e-mail it would accept it too, but it 
>the sender host isn't valid it will reject it.
>
>Regards,
>
>Johan
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] URGENT-HELP !!!!!!


>
>
>
>I am talking about the final SMTP host.. it will do a reverse lookup on the
>From: domain and if it dont resolve to the IP of the sending STMP host it
>will reject it.
>
yes I know. But it the final SMTP tries to resolve the host (localhost) 
it will get a response from it self? I haven't tried it, but I think it 
would work.

By the way... the most of the SMTP doesn't check at the FROM header, but 
from the sender SMTP.
So if you got a nonexisting e-mail it would accept it too, but it the 
sender host isn't valid it will reject it.

Regards,

Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] URGENT-HELP !!!!!!


> hmm, youre right.
>
> You can use this header maybe "FROM: Do Not Reply "
>
> The SMTP should be able to resolve localhost?

hmm, no

I am talking about the final SMTP host.. it will do a reverse lookup on the
From: domain and if it dont resolve to the IP of the sending STMP host it
will reject it.

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] URGENT-HELP !!!!!!


hmm, youre right.

You can use this header maybe "FROM: Do Not Reply "

The SMTP should be able to resolve localhost?

Regards,

Johan



Jon Farmer wrote:

>Problem with that solution is some SMTP hosts will reject messages from
>domains that do not resolve to the sending SMTP host. I would recommend
>setting up a alias on sendmail and pipe all email to that address to
>/dev/null
>
>You would need to stress to your recipients that all replies to that email
>are ignored.
>
>Regards
>
>Jon
>--
>Jon Farmer
>Systems Programmer, Entanet www.enta.net
>Tel 01952 428969 Mob 07763 620378
>PGP Key available, send email with subject: Send PGP Key
>
>
>- Original Message -
>From: "Chamarty Prasanna Kumar" <[EMAIL PROTECTED]>
>To: "Johan Holst Nielsen" <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Friday, November 30, 2001 10:54 AM
>Subject: Re: Re: [PHP] URGENT-HELP !!
>
>
>>
>>
>>
>>Thanks very much !! Smart solution !!
>>
>>yes, I don't want to get reply from that mail.
>>
>>Just looking for any solution..if u finds one
>>
>>please let me know.
>>
>>Regards,
>>
>>Kumar.
>>
>>
>>
>>
>>On Fri, 30 Nov 2001 Johan Holst Nielsen wrote :
>>
>>>>
>>>>
>>>>  Want to send "mail" through PHP script such that
>>>>
>>>>the receiver of that mail should not contain FROM
>>>>
>>>>header.
>>>>
>>>>I used mail() function with empty FROM header and
>>>>
>>>>even without FROM header, but the receiver is still
>>>>
>>>>getting FROM address as [EMAIL PROTECTED]
>>>>
>>>You can't. The mail specification have to get a FROM
>>>header, but to make
>>>a solution you can make a FROM header like this: "FROM:
>>>Do Not Reply
>>><[EMAIL PROTECTED]>"
>>>
>>>regards,
>>>
>>>Johan
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>p.net
>>>For additional commands, e-mail:
>>>[EMAIL PROTECTED]
>>>To contact the list administrators, e-mail:
>>>[EMAIL PROTECTED]
>>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>
>




Re: Re: [PHP] URGENT-HELP !!!!!!


Problem with that solution is some SMTP hosts will reject messages from
domains that do not resolve to the sending SMTP host. I would recommend
setting up a alias on sendmail and pipe all email to that address to
/dev/null

You would need to stress to your recipients that all replies to that email
are ignored.

Regards

Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key


- Original Message -
From: "Chamarty Prasanna Kumar" <[EMAIL PROTECTED]>
To: "Johan Holst Nielsen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 30, 2001 10:54 AM
Subject: Re: Re: [PHP] URGENT-HELP !!


>
>
>
>
> Thanks very much !! Smart solution !!
>
> yes, I don't want to get reply from that mail.
>
> Just looking for any solution..if u finds one
>
> please let me know.
>
> Regards,
>
> Kumar.
>
>
>
>
> On Fri, 30 Nov 2001 Johan Holst Nielsen wrote :
> > >
> > >
> > >
> > >   Want to send "mail" through PHP script such that
> > >
> > >the receiver of that mail should not contain FROM
> > >
> > >header.
> > >
> > >I used mail() function with empty FROM header and
> > >
> > >even without FROM header, but the receiver is still
> > >
> > >getting FROM address as [EMAIL PROTECTED]
> > >
> >
> > You can't. The mail specification have to get a FROM
> > header, but to make
> > a solution you can make a FROM header like this: "FROM:
> > Do Not Reply
> > <[EMAIL PROTECTED]>"
> >
> > regards,
> >
> > Johan
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > p.net
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: Re: [PHP] URGENT-HELP !!!!!!






Thanks very much !! Smart solution !!

yes, I don't want to get reply from that mail.

Just looking for any solution..if u finds one

please let me know.

Regards,

Kumar.




On Fri, 30 Nov 2001 Johan Holst Nielsen wrote :
> >
> >
> >
> >   Want to send "mail" through PHP script such that
> >
> >the receiver of that mail should not contain FROM
> >
> >header.
> >
> >I used mail() function with empty FROM header and
> >
> >even without FROM header, but the receiver is still
> >
> >getting FROM address as [EMAIL PROTECTED]
> >
> 
> You can't. The mail specification have to get a FROM 
> header, but to make 
> a solution you can make a FROM header like this: "FROM: 
> Do Not Reply 
> <[EMAIL PROTECTED]>"
> 
> regards,
> 
> Johan
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> p.net
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] URGENT-HELP !!!!!!


>
>
>
>   Want to send "mail" through PHP script such that
>
>the receiver of that mail should not contain FROM
>
>header.
>
>I used mail() function with empty FROM header and
>
>even without FROM header, but the receiver is still
>
>getting FROM address as [EMAIL PROTECTED]
>

You can't. The mail specification have to get a FROM header, but to make 
a solution you can make a FROM header like this: "FROM: Do Not Reply 
<[EMAIL PROTECTED]>"

regards,

Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] URGENT-HELP !!!!!!




Hi,

   Want to send "mail" through PHP script such that

the receiver of that mail should not contain FROM

header.

I used mail() function with empty FROM header and

even without FROM header, but the receiver is still

getting FROM address as [EMAIL PROTECTED]



Anyone can help 


Thanks in advance,

Kumar. 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent Help: Problem with apache+php


Hi Imran!
On Sat, 30 Jun 2001, Imran Hussain wrote:

> hi
> 
>   Iam running Freebsd4.3 i hv installed  apache-1.3.20,php4.0.5 and
> postgres-6.5.3. there was no problem with the configuration of all
> the above packages, My problem is when i start apache it gives me this error.
> 
> hub#/usr/local/apache/bin/apachectl start
> Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
> Cannot load /usr/local/apache/libexec/libphp4.so into server:
> /usr/local/apache/libexec/libphp4.so: Undefined symbol "PQoidValue"
> /usr/local/apache/bin/apachectl start: httpd could not be started
> hub#
> 
>  before this it was saying libphp4.so not found then i had to do
> ldconfig with the path to the lib dir then it gave me this errorcan
> anyone help me on this issue.
> 

as root:
ldconfig -m /path/to/postgres/libs/dir/

e.g.:
ldconfig -m  /usr/local/pgsql/lib

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent help needed, sound scary when anyone did that ontitle :-)


On Thu, 25 Jan 2001, Jacky@lilst wrote:

> $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; 
> $resultsql1 = mysql_query($sql1);
> $sqlLastID = "select LAST_INSERT_ID() from firsttable";
> $resultlast = mysql_query($sqlLastID);
> $FirstLast = mysql_result($resultlast,0,0);



First of all, let's rewrite your code.



It's *very important* that you specify which connection you want mysql to
use!  I can't stress this enough.  If more than one connection gets opened
(you use phplib for instance, it opens its own connection), and if you
don't specify which you're using, you'll get random results, and you'll
interfere with the *other* connection.  Just because PHP says the
connection is optional doesn't mean it always is.  Use it anyway.

I say this because you had a later post complaining about how mysql said
you didn't select a database.  Maybe you didn't.

This goes for everyone here.  Not specifying which connection is in use is
*sloppy* and may lead to bugs you can't track down!  At the last place I
worked, we started using phplib after everything was written, and it
*broke everything* because nobody was paying attention to the connections
they opened.  We had to audit the code for days to track everything down.

Do yourself a favor *right now* and grep -r your codebase for all database
related functions. (grep -ir "mysql_" *) and FIX THEM NOW.  That way,
you'll be safe knowing that it's *your* connection that's in use.

And always remember, mysql_error($CONN) is your friend.

Cheers!

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. ThomasINN Database Programmer  |
| Phone: (309) 743-0812  Fax  : (309) 743-0830|
| Email: [EMAIL PROTECTED]AIM  : trifthen  |
| Web  : www.townnews.com |
| |
| "Most of our lives are about proving something, either to   |
| "ourselves or to someone else." |
|   -- Anonymous  |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent help needed, sound scary when anyone did that on title :-)


I did try mysql_error() to see waht exactly is my problem and here hwat I
really need to know. My sniplet was all correct about using last_insert_id()
and the message from mysql_error(0 tells me that "no selected database".
Although I did use mysql_select_db already and I am sure there is nothing
wrong with that part of code. The real problem is when I don't think I added
user to this database properly previously so I simply went to grab another
username that provide me the access to the database, but unfortunately
different one, stupid me.
So what I cannot do here is that now I have database on mysql server call
"FreeSale" and I need to add user in it, how do I do that properly?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Maxim Maletsky <[EMAIL PROTECTED]>
To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 24, 2001 10:22 PM
Subject: RE: [PHP] Urgent help needed, sound scary when anyone did that on
title :-)


> you know Jacky, there's another, less cool and less reliable way to get
the
> last inserted id:
>
> SELECT id FROM table ORDER BY id DESC;
>
> it will sort them all giving you the biggest id *number* (not what mysql
> keeps) and you can keep it for as many milliseconds your script will run
> more...
>
> So if nothing else works for you - try this...
> (depends on how secure & stable you want your application to be, of
> course...)
>
> Cheers,
> Maxim Maletsky
>
> -Original Message-
> From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 1:21 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Urgent help needed, sound scary when anyone did that on
> title :-)
>
>
> Hi people,
> I got here the syntax that is suppose to get the id from the "just
inserted"
> record and store it in value, did not work so far and I cannot see what is
> wrong in there, can anyone give me a hint what is wrong here? ( And the
> reason I did not use mysql_insert_id here is because the ID field at my
> tables are all BIGINT so mysql_insert_id won't work, so I have to use
> LAST_INSERT_ID() instead). By the way, the error after the page is
executed
> keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the
> line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for
the
> value of $FirstLast, it showed that there is no value in there.
>
> Sniplet is like this: ( I tried to keep this down as much as try to give
> most detail at the same time, so apologize for too long sniplet).
>
> $sql1 = "insert into firsttable (firstname, lastname)
> values('Jack','Chan')";
> $resultsql1 = mysql_query($sql1);
> $sqlLastID = "select LAST_INSERT_ID() from firsttable";
> $resultlast = mysql_query($sqlLastID);
> $FirstLast = mysql_result($resultlast,0,0);
>
> $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname)
> values('$FirstLast','Jacky','Chany')";
> $resultsql2 = mysql_query($sql2);
> $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
> $resultlast2 = mysql_query($sqlLastIDsec);
> $secondLast = mysql_result($resultlast2,0,0);
>
> $sql3 = "insert into Thirdtable
(SecondTableID,FirsttableID,Thirdfirstname,
> Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')";
> $resultsql3 = mysql_query($sql3);
> $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
> $resultlast3 = mysql_query($sqlLastIDthird);
> $ThirdLast = mysql_result($resultlast3,0,0);
>
> **
> what have I done wrong? Please enlighten me here
> Thanks
>
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Urgent help needed, sound scary when anyone did that on title :-)


you know Jacky, there's another, less cool and less reliable way to get the
last inserted id:

SELECT id FROM table ORDER BY id DESC;

it will sort them all giving you the biggest id *number* (not what mysql
keeps) and you can keep it for as many milliseconds your script will run
more...

So if nothing else works for you - try this...
(depends on how secure & stable you want your application to be, of
course...)

Cheers,
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Urgent help needed, sound scary when anyone did that on
title :-)


Hi people,
I got here the syntax that is suppose to get the id from the "just inserted"
record and store it in value, did not work so far and I cannot see what is
wrong in there, can anyone give me a hint what is wrong here? ( And the
reason I did not use mysql_insert_id here is because the ID field at my
tables are all BIGINT so mysql_insert_id won't work, so I have to use
LAST_INSERT_ID() instead). By the way, the error after the page is executed
keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the
line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the
value of $FirstLast, it showed that there is no value in there. 

Sniplet is like this: ( I tried to keep this down as much as try to give
most detail at the same time, so apologize for too long sniplet). 

$sql1 = "insert into firsttable (firstname, lastname)
values('Jack','Chan')"; 
$resultsql1 = mysql_query($sql1);
$sqlLastID = "select LAST_INSERT_ID() from firsttable";
$resultlast = mysql_query($sqlLastID);
$FirstLast = mysql_result($resultlast,0,0);

$sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname)
values('$FirstLast','Jacky','Chany')"; 
$resultsql2 = mysql_query($sql2);
$sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
$resultlast2 = mysql_query($sqlLastIDsec);
$secondLast = mysql_result($resultlast2,0,0);

$sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname,
Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; 
$resultsql3 = mysql_query($sql3);
$sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
$resultlast3 = mysql_query($sqlLastIDthird);
$ThirdLast = mysql_result($resultlast3,0,0);

**
what have I done wrong? Please enlighten me here
Thanks

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent help needed, sound scary when anyone did that on title :-)


I don't think I can use mysql_insert_id() because the ID field in the tables
are all BIGINT Auto_Increment and I saw that in the manual, it said
mysql_insert_id will not work corerctly with this type of data.
I hope I am wrong though. But if it is as the manual said, what else could I
do?
Direct quote from the manul at the part about mysql_insert_id() is here:
***
mysql_insert_id() converts the return type of the native MySQL C API
function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column
has a column type of BIGINT, the value returned by mysql_insert_id() will be
incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID().

cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Joe Stump <[EMAIL PROTECTED]>
To: Jacky@lilst <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 24, 2001 9:25 PM
Subject: Re: [PHP] Urgent help needed, sound scary when anyone did that on
title :-)


> remove the result - so just type $id = mysql_insert_id() and it should
work
> fine.
>
> --Joe
>
>
> On Thu, Jan 25, 2001 at 10:21:17AM -0600, Jacky@lilst wrote:
> > Hi people,
> > I got here the syntax that is suppose to get the id from the "just
inserted" record and store it in value, did not work so far and I cannot see
what is wrong in there, can anyone give me a hint what is wrong here? ( And
the reason I did not use mysql_insert_id here is because the ID field at my
tables are all BIGINT so mysql_insert_id won't work, so I have to use
LAST_INSERT_ID() instead). By the way, the error after the page is executed
keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the
line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the
value of $FirstLast, it showed that there is no value in there.
> >
> > Sniplet is like this: ( I tried to keep this down as much as try to give
most detail at the same time, so apologize for too long sniplet).
> >
> > $sql1 = "insert into firsttable (firstname, lastname)
values('Jack','Chan')";
> > $resultsql1 = mysql_query($sql1);
> > $sqlLastID = "select LAST_INSERT_ID() from firsttable";
> > $resultlast = mysql_query($sqlLastID);
> > $FirstLast = mysql_result($resultlast,0,0);
> >
> > $sql2 = "insert into secondtable (FirsttableID,secfirstname,
seclastname) values('$FirstLast','Jacky','Chany')";
> > $resultsql2 = mysql_query($sql2);
> > $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
> > $resultlast2 = mysql_query($sqlLastIDsec);
> > $secondLast = mysql_result($resultlast2,0,0);
> >
> > $sql3 = "insert into Thirdtable
(SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname)
values('$secondLast','$FirstLast','Steve','Chan')";
> > $resultsql3 = mysql_query($sql3);
> > $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
> > $resultlast3 = mysql_query($sqlLastIDthird);
> > $ThirdLast = mysql_result($resultlast3,0,0);
> >
> > **
> > what have I done wrong? Please enlighten me here
> > Thanks
> >
> > Jack
> > [EMAIL PROTECTED]
> > "There is nothing more rewarding than reaching the goal you set for
yourself"
>
> --
>
> Joe Stump, PHP Hacker
> [EMAIL PROTECTED]
> http://www.miester.org/
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent help needed, sound scary when anyone did that on title :-)


remove the result - so just type $id = mysql_insert_id() and it should work
fine.

--Joe


On Thu, Jan 25, 2001 at 10:21:17AM -0600, Jacky@lilst wrote:
> Hi people,
> I got here the syntax that is suppose to get the id from the "just inserted" record 
>and store it in value, did not work so far and I cannot see what is wrong in there, 
>can anyone give me a hint what is wrong here? ( And the reason I did not use 
>mysql_insert_id here is because the ID field at my tables are all BIGINT so 
>mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, 
>the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql 
>index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I 
>did echo for the value of $FirstLast, it showed that there is no value in there. 
> 
> Sniplet is like this: ( I tried to keep this down as much as try to give most detail 
>at the same time, so apologize for too long sniplet). 
> 
> $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; 
> $resultsql1 = mysql_query($sql1);
> $sqlLastID = "select LAST_INSERT_ID() from firsttable";
> $resultlast = mysql_query($sqlLastID);
> $FirstLast = mysql_result($resultlast,0,0);
> 
> $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) 
>values('$FirstLast','Jacky','Chany')"; 
> $resultsql2 = mysql_query($sql2);
> $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
> $resultlast2 = mysql_query($sqlLastIDsec);
> $secondLast = mysql_result($resultlast2,0,0);
> 
> $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, 
>Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; 
> $resultsql3 = mysql_query($sql3);
> $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
> $resultlast3 = mysql_query($sqlLastIDthird);
> $ThirdLast = mysql_result($resultlast3,0,0);
> 
> **
> what have I done wrong? Please enlighten me here
> Thanks
> 
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for yourself"

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.org/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Urgent help needed, sound scary when anyone did that on title :-)


Hi people,
I got here the syntax that is suppose to get the id from the "just inserted" record 
and store it in value, did not work so far and I cannot see what is wrong in there, 
can anyone give me a hint what is wrong here? ( And the reason I did not use 
mysql_insert_id here is because the ID field at my tables are all BIGINT so 
mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, 
the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql 
index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I 
did echo for the value of $FirstLast, it showed that there is no value in there. 

Sniplet is like this: ( I tried to keep this down as much as try to give most detail 
at the same time, so apologize for too long sniplet). 

$sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; 
$resultsql1 = mysql_query($sql1);
$sqlLastID = "select LAST_INSERT_ID() from firsttable";
$resultlast = mysql_query($sqlLastID);
$FirstLast = mysql_result($resultlast,0,0);

$sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) 
values('$FirstLast','Jacky','Chany')"; 
$resultsql2 = mysql_query($sql2);
$sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
$resultlast2 = mysql_query($sqlLastIDsec);
$secondLast = mysql_result($resultlast2,0,0);

$sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, 
Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; 
$resultsql3 = mysql_query($sql3);
$sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
$resultlast3 = mysql_query($sqlLastIDthird);
$ThirdLast = mysql_result($resultlast3,0,0);

**
what have I done wrong? Please enlighten me here
Thanks

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"