Re: [PHP-DB] last insert ID

2005-01-03 Thread list
hi
you can use the mysql function LAST_INSERT_ID()
heres the info from the manual:
http://dev.mysql.com/doc/mysql/en/ODBC_and_last_insert_id.html
hope that helps
eoghan
Nathan Mealey wrote:
Is there a PEAR::DB equivalent to the mysql_insert_id()? I can't figure 
out how to get the primary key ID from the last insert query, without 
doing a second query (which seems ridiculous).

On that same note, are the mysql_insert_id() and pg_last_oid() 
equivalent? I thought they were, but when I used pg_last_oid() I got 
some crazy number that was definitely not the last primary key ID.

Thanks,
Nathan
--
Nathan Mealey
Director of Operations
Cycle-Smart, Inc.
P.O. Box 1482
Northampton, MA
01061-1482
[EMAIL PROTECTED]
(413) 210-7984
(512) 681-7043 Fax
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Approved

2003-09-07 Thread L-Soft list server at Computer Associates International (1.8e)
 Please see the attached file for details.
Unknown command - PLEASE. Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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



[PHP-DB] [SPAM?] [PHP-DB] Re: Approved

2003-09-07 Thread L-Soft list server at Computer Associates International (1.8e)
This mail is probably spam.  The original message has been attached
along with this report, so you can recognize or block similar unwanted
mail in future.  See http://spamassassin.org/tag/ for more details.

Content preview:   Please see the attached file for details. Unknown
  command - PLEASE. Try HELP. Summary of resource utilization CPU time:
  0.000 sec Overhead CPU: 0.000 sec CPU model: 4-CPU 700MHz Pentium III
  Xeon 1M (2048M) Job origin: [EMAIL PROTECTED] [...] 

Content analysis details:   (5.20 points, 5 required)
SUBJ_HAS_SPACES(1.7 points)  Subject contains lots of white space
RCVD_IN_OSIRUSOFT_COM (0.6 points)  RBL: Received via a relay in relays.osirusoft.com
   [RBL check: found 4.131.92.216.relays.osirusoft.com.]
X_OSIRU_OPEN_RELAY (2.9 points)  RBL: DNSBL: sender is Confirmed Open Relay


---BeginMessage---
 Please see the attached file for details.
Unknown command - PLEASE. Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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


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

[PHP-DB] Re: That movie

2003-09-04 Thread L-Soft list server at Computer Associates International (1.8e)
 Please see the attached file for details.
Unknown command - PLEASE. Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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



[PHP-DB] [SPAM?] [PHP-DB] Re: That movie

2003-09-04 Thread L-Soft list server at Computer Associates International (1.8e)
This mail is probably spam.  The original message has been attached
along with this report, so you can recognize or block similar unwanted
mail in future.  See http://spamassassin.org/tag/ for more details.

Content preview:   Please see the attached file for details. Unknown
  command - PLEASE. Try HELP. Summary of resource utilization CPU time:
  0.000 sec Overhead CPU: 0.000 sec CPU model: 4-CPU 700MHz Pentium III
  Xeon 1M (2048M) Job origin: [EMAIL PROTECTED] [...] 

Content analysis details:   (5.20 points, 5 required)
SUBJ_HAS_SPACES(1.7 points)  Subject contains lots of white space
RCVD_IN_OSIRUSOFT_COM (0.6 points)  RBL: Received via a relay in relays.osirusoft.com
   [RBL check: found 4.131.92.216.relays.osirusoft.com.]
X_OSIRU_OPEN_RELAY (2.9 points)  RBL: DNSBL: sender is Confirmed Open Relay


---BeginMessage---
 Please see the attached file for details.
Unknown command - PLEASE. Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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


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

[PHP-DB] Your details

2003-08-20 Thread linux-list-request
See the attached file for details
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] redirect

2003-03-01 Thread Kurth Bemis (List Monkey)
At 04:33 PM 3/1/2003 -0500, Jeremi Bergman wrote:

www.php.net/round

find the answer there, you will :-)

~kurth

Nevermind, I found the answer, and why it wasn't working.  Now I was
wondering how I can format a number to be a currency?  Like if
$totalprice = 14.343 have it print 14.34.
thanks

-Original Message-
From: Jeremi Bergman [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 2:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] redirect
How can I redirect a user to a specific page if they are already
authenticated?
if ($SESSION_Authenticated) { //code here to redirect; }

thanks



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




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


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


Re: [PHP-DB]

2003-02-12 Thread Kurth Bemis (List Monkey)
At 03:40 PM 2/12/2003 +0200, nikos wrote:

I bet that google does...

or the search engine at mysql.com does

~kurth



Hi List!

I'm trying to Drop a Table and aI get an error as follows:
Error on delete of './horceng/oikology.MYI' (Errcode: 13)

Does anybody know what is the error 13?
Thanks


Qbit
ÃáôóÞò Íßêïò - Gatsis Nikos
Web developer
tel.: 2108256721 - 2108256722
fax: 2108256712
email: [EMAIL PROTECTED]
http://www.qbit.gr




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




Re: [PHP-DB] hotlink MySQL

2002-10-15 Thread Kurth Bemis (List Monkey)

At 07:55 PM 10/15/2002 +0200, Seabird wrote:

yes - just specify the hostname that your mysql DB resides on.  And make 
sure that your mysql users is allowed to connect from the host that your 
APP or page or whatever is on.

~kurth

Is it possible to hotlink a MySQL database?

my site location is different then my MySQL location. (or at least a site).
Is it possible to use the database for both sites or should I set up the
database at both locations?

The reason for asking is that one of the locations doesn't provide MySQL
DB's anymore (max number of DB's is limited)

Pls let me know if this is possible, and if so, how.

Thanx,

Jacco
http://seabird.coolfreepage.com/main2.php




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



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




[PHP-DB] https post via php

2002-03-28 Thread mailing list

Hello,

I am attempting to POST to a https://whatever.url.com server and return
the result from the server into the script without the user knowing using
a php script.  I can not use CURL becuase the shared server I have hosting
this site was not compiled -with-curl.  I downloaded HTTP_POST PHP script
from: http://px.sklar.com/code.html?code_id=313.  Here is my code that I
am using to call the functions:

?php

require('classes2.php');

//instantiate class http_post
$a = new http_post;

//define variables

$a-set_server(onlinechecks.interceptcorporation.com);
$a-set_port(443);
$a-set_file(/icolc/short.cgi);
$a-set_action(https://onlinechecks.interceptcorporation.com/icolc/short.cgi;);
$a-set_enctype(application/x-www-form-urlencoded);
$a-set_element(array(MEN = 789,MPA = 456, MID = 7015,CRO
= 123456780,CAC = 123123123,
CPH = 17015551212,PAM = 12.34));
$a-set_timeout(20);
$a-show_post();
$a-send($display=1);

?

Here is the result returned from the browser:

Bad Request
Your browser sent a request that this server could not understand.

Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint: https://206.11.164.21/


Apache/1.3.20 Server at 206.11.164.21 Port 80

Does anyone have any ideas?


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



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




[PHP-DB] https post using php

2002-03-27 Thread mailing list

Hello,

I am attempting to POST to a https://whatever.url.com server and return
the result from the server into the script without the user knowing using
a php script.  I can not use CURL becuase the shared server I have hosting
this site was not compiled -with-curl.  I downloaded HTTP_POST PHP script
from: http://px.sklar.com/code.html?code_id=313.  Here is my code that I
am using to call the functions:

?php

require('classes2.php');

//instantiate class http_post
$a = new http_post;

//define variables

$a-set_server(onlinechecks.interceptcorporation.com);
$a-set_port(443);
$a-set_file(/icolc/short.cgi);
$a-set_action(https://onlinechecks.interceptcorporation.com/icolc/short.cgi;);
$a-set_enctype(application/x-www-form-urlencoded);
$a-set_element(array(MEN = 789,MPA = 456, MID = 7015,CRO
= 123456780,CAC = 123123123,
CPH = 17015551212,PAM = 12.34));
$a-set_timeout(20);
$a-show_post();
$a-send($display=1);

?

Here is the result returned from the browser:

Bad Request
Your browser sent a request that this server could not understand.

Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint: https://206.11.164.21/


Apache/1.3.20 Server at 206.11.164.21 Port 80

Does anyone have any ideas?


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




[PHP-DB] post to a url and return to same page

2002-03-18 Thread mailing list

Hello,

I am trying to post to a URL and return to the same page with the result
and or error messages.  The shared server that is hosting this site was
not compiled with CURL.  Is there an alternative way to post a form to an
alternate url and return to the same page without having to rely on the
alternate URL's server?

Regards,

Adrian


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




Re(2): Re(2): Re(2): [PHP-DB] Fatal Error using mysql_connect()

2002-03-13 Thread mailing list

[EMAIL PROTECTED] writes:

I'm confused as to what exactly you have done here. You say it compiled 
without any errors using -with-mysql=/usr

But then your config from phpinfo() shows:

  --with-mysql=shared



My advice is to do a clean installation: delete your current php src 
directory, extract the php tarball into a new directory then run

 configure
 make
 stop webserver
 make install
 restart webserver



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

Jason,

I just deleted the current php src directory and extracted a new
downloaded version 4.06 from PHP.NET.  I did the following:

attempt 1.) ./configure --with-mysql=/usr/lib/mysql
result 1.) configure: error: Cannot find header files under /usr/lib/mysql

attempt 2.) ./configure --with-mysql=/usr/include/mysql
result 2.) configure: error: Cannot find header files under
/usr/include/mysql

attempt 3.) ./configure --with-mysql=/usr
result 3.) everything will compile find except that the configure command
from phpinfo() reads:
[SNIP] --with-mysql=shared' '

I am not sure where to point --with-mysql=[DIR].  How do I know I am
pointing it to the correct directory?

Regards,

Adrian



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




[PHP-DB] Fatal Error using mysql_connect()

2002-03-12 Thread mailing list

Hello,

I am receiving a fatal error on a php page:

Fatal error: Call to undefined function: mysql_connect() in
/www/meyercousa/pages/view_data.php on line 13


My syntax on line 13 is: $db = mysql_connect('localhost', 'username',
'password');

Anyone have any ideas?

Regards,

Adrian Mcmanus
IT Director
[EMAIL PROTECTED]


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




Re(2): Re(2): [PHP-DB] Fatal Error using mysql_connect()

2002-03-12 Thread mailing list

[EMAIL PROTECTED] writes:
Try:

  -with-mysql=/usr


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Absence diminishes mediocre passions and increases great ones,
as the wind blows out candles and fans fires.
   -- La Rochefoucauld
*/

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

It compiled without any errors using -with-mysql=/usr

However I still receive an error while trying to connect to my mysql
database:

Fatal error: Call to undefined function: mysql_connect() in
/www/meyercousa/pages/view_data.php on line 13

I have pasted my configuration from phpinfo().  Hope this helps

 './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization' '--with-bz2'
'--with-curl' '--with-db3' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-gd' '--with-gdbm' '--with-gettext'
'--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm'
'--with-openssl' '--with-png' '--with-pspell' '--with-regex=system'
'--with-ttf' '--with-xml' '--with-expat-dir=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8'
'--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos'
'--with-ldap=shared' '--with-mysql=shared' '--with-pgsql=shared'
'--with-unixODBC=shared' '--with-apxs=/usr/sbin/apxs'


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




[PHP-DB] compiling php for mysql on linux

2002-03-12 Thread mailing list

Hello,

I am still recieving errors when I try to connect to my MYSQL database
using php.

Here is the error that is generated on the page:

Fatal error: Call to undefined function: mysql_connect() in
/www/meyercousa/pages/view_data.php on line 13

As instructed from a previous post I recompiled php using the following
commands:

./configure --with-mysql=/usr/lib/mysql
(recieved the following error: configure: error: Cannot find header files
under /usr/include/mysql)

./configure --with-mysql=/usr/include/mysql
(same error)

./configure --with-mysql=/usr
(as far as I can tell everything has compiled ok except I still recieve
the following error:  Fatal error: Call to undefined function:
mysql_connect() in /www/meyercousa/pages/view_data.php on line 13)

I have pasted the configuration command:

'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization' '--with-bz2'
'--with-curl' '--with-db3' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-gd' '--with-gdbm' '--with-gettext'
'--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm'
'--with-openssl' '--with-png' '--with-pspell' '--with-regex=system'
'--with-ttf' '--with-xml' '--with-expat-dir=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8'
'--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos'
'--with-ldap=shared' '--with-mysql=shared' '--with-pgsql=shared'
'--with-unixODBC=shared' '--with-apxs=/usr/sbin/apxs'

I hope this helps.

Regards,

Adrian


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




Re: [PHP-DB] Query construction (again)

2001-08-22 Thread Gremlins Mailing List

- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:16 PM
Subject: [PHP-DB] Query construction (again)


 Hey there folks - similar problem - different project!

 I want to select some records for a period of 7days after their insert
[dateFrom] date.
 Last time I asked you guys for help I was helped toward the following
solution:

 $sql = SELECT * FROM $Tpostings WHERE now()=dateFrom AND now()dateTo;

 The problem in this new project is that the 'dateTo' field is not included
in the DB. It is 7-days
 after 'dateFrom'. So why does the following query not work:

 $sql = SELECT * FROM $tabitem WHERE DATE_ADD(submitDate, INTERVAL 7
DAY);
 No error is received though...

There is no comparison in your WHERE clause. Try something like:

$sql = SELECT * FROM $tabitem WHERE DATE_ADD(submitDate, INTERVAL 7 DAY) =
now();

Depending on how the date is stored (date + time, or just date) you may have
to modify the output of now() to match.

hth
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk




-- 
PHP Database 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-DB] determining the value of an auto-incremented field (mysql)

2001-08-16 Thread Gremlins Mailing List

- Original Message -
From: Kenn Murrah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 17, 2001 1:17 AM
Subject: [PHP-DB] determining the value of an auto-incremented field (mysql)


[snip]

 Having done so, how can I immediately determine the  value of order_number
 for this entry, i.e. the auto-incremented value assigned by MySQL?

Use mysql_insert_id(), it returns the ID generated for an AUTO_INCREMENT
column by the previous INSERT query.


regards
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk




-- 
PHP Database 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-DB] INSERT Won't Insert

2001-08-01 Thread Gremlins Mailing List

Steve

I believe you're missing the closing bracket ) after $Website.

I think it's clearer if you use single quotes (') rather than double quotes
and then having to escape them.

Something like:

INSERT INTO $table_name
 (CompanyID, CompanyName, Address, City, StateorProvince,
PostalCode,Region,Country,WebSite)
 VALUES ('',
 '$CompanyName',
 '$Address',
 '$City',
 '$StateorProvince',
 '$PostalCode',
 '$Region',
 '$Country',
 '$WebSite');

regards
--
Jason Wong
Gremlins Associates

- Original Message -
From: Steve Fitzgerald [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 02, 2001 2:35 AM
Subject: [PHP-DB] INSERT Won't Insert


 This should be a simple insert. I must be missing something because I keep
 getting: Couldn't execute query.

 What am I missing?

 ?
 error_reporting(15);

 $db_name = dbname;
 $table_name=company;
 $connection = @mysql_connect(servname,username, password)or die
 (Couldn't connect.);

 $db = @mysql_select_db($db_name, $connection) or die (Couldn't select
 database.);

 $add_co_sql = INSERT INTO $table_name
 (CompanyID, CompanyName, Address, City, StateorProvince,
 PostalCode,Region,Country,WebSite)
 VALUES
 (\\,

\$CompanyName\,\$Address\,\$City\,\$StateorProvince\,\$PostalCode\
 ,\$Region\,\$Country\,\$WebSite\
 ;

 $result = @mysql_query($add_co_sql, $connection) or die (Couldn't execute
 query.);
 ?




 --
 PHP Database 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 Database 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]