[PHP-DB] Get the id generated from the previous INSERT operation

2001-05-06 Thread Alpha

mysql_insert_id - Get the id generated from the previous INSERT operation

So how do I do that in ms-sql?

- Alpha


-- 
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-DB] file() shooting blanks - importing fixed width file for use in MySQL

2001-05-06 Thread Jay Lepore

Hello,

I have an ASCII fixed width text file I'm trying to convert to an array of
fields.

When I use file() to place each line (record) in it's own array element, it
strips out any blanks it finds except one.  This results in in ABC
MOTORS becoming ABC MOTORS.  That creates a problem if ABC is in a fixed
width 5 character field and MOTORS is in its own field.

Any ideas on how to get file() to not shoot out my blanks would be
appreciated.

[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]




[PHP-DB] php/mySQL and html select

2001-05-06 Thread Nick Terzich

hi...

I have a user registration system that I need to add a
state field to. Part of the form will look something
like this but with all 50 states instead of just two:

form
select name=state
option value=AKAK/option
option value=ALAL/option
/select
/form

...how do I insert the user's state into the database
and then how do I show the user's state as the
selected state in the drop down list later when the
user comes back to update his/her profile?

hope this makes sense.. thanks,

nick


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

-- 
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] php/mySQL and html select

2001-05-06 Thread Tom Carter

Hi Nick,

Assuming you have the rest of the databse interaction, all you need to is
store the value of the selection (the store script will recieve a varialbe
$state=AK or whatever.

To then display the users state do the following
//Get the users state from the database
//do this however appropiate in your code
$users_state = AK; //(for the sake of argument)

//create array of states (better way of making the form
$states = array(AK,AR,);

$numstates=count($states);
echo(select name=\state\);
for($i=0;$inumstates;$i++)
{
$currstate=$states[$i];
echo(option value=\$currstate\); //print first part of statement
//if this option is the users add the selected keywork
if($currstate==$users_state) echo( SELECTED);
echo( $currstate);//finish the tag
}
echo(/select);

Hope this helps!
Tom




 On Sun, 6 May 2001, Nick
Terzich wrote:

 hi...

 I have a user registration system that I need to add a
 state field to. Part of the form will look something
 like this but with all 50 states instead of just two:

 form
 select name=state
 option value=AKAK/option
 option value=ALAL/option
 /select
 /form

 ...how do I insert the user's state into the database
 and then how do I show the user's state as the
 selected state in the drop down list later when the
 user comes back to update his/her profile?

 hope this makes sense.. thanks,

 nick


 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/

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




Re: [PHP-DB] Get the id generated from the previous INSERT operation

2001-05-06 Thread Felix Kronlage

On Sun, May 06, 2001 at 07:22:24PM +0200, Alpha wrote:

 mysql_insert_id - Get the id generated from the previous INSERT operation
 So how do I do that in ms-sql?

as sql it should be something like '@@IDENTITY'don't know if there
is a php-function for it, just worked with ms-sql via java.

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 


-- 
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-DB] invalid select results from sybase with php

2001-05-06 Thread David Olszyski

Hello.

I have a strange problem. Look:

$query = select id from rates where id = 9521.0;
$result = sybase_query($query);
$a = sybase_fetch_row($result);
echo $a[0];

This code prints number 9520.0!!!

The column id is auto-incremented so it always has a unique value. But when 
I select values from this column using php I get a list like this:
9520.0
9520.0
9522.0
9524.0
9524.0
9524.0
...,
while doing the same query from isql or from perl DBI I get correct values:
9520
9521
9522
9523
9524
9525
...

Can anyone help me with this?

I use PHP 4.0.4pl1 (./configure --with-mysql --with-apache=../apache 
--enable-track-vars --enable-trans-sid) compiled in Apache/1.3.19, Linux 
2.4.2 SMP, Sybase 11.9.2.4, RedHat 7.0.

David Olszynski

-- 
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-DB] Your Internet Education!

2001-05-06 Thread Noel Hadfield

Learn about computers and the Internet and build a business while you are 
doing it.

Just hit:

mailto:[EMAIL PROTECTED]?Subject=Education

To be removed from this list, hit:

mailto:[EMAIL PROTECTED]?Subject=Remove

-- 
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] Your Internet Education!

2001-05-06 Thread Beau Lebens

something tells me that people on a php database mailing list already know a
little about computers and the internet...

dick

// -Original Message-
// From: Noel Hadfield [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 7 May 2001 10:54 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Your Internet Education!
//
//
// Learn about computers and the Internet and build a business
// while you are
// doing it.
//
// Just hit:
//
// mailto:[EMAIL PROTECTED]?Subject=Education
//
// To be removed from this list, hit:
//
// mailto:[EMAIL PROTECTED]?Subject=Remove
//
// --
// 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]