Re: [PHP-DB] PHP, MySQL and WML!

2001-01-25 Thread Andrew Apold

>INSERT INTO employees (first,last,address,position) VALUES 
>('$(first)','$(last)','$(address)','$(position)')
>is because in WML variables are stored as $(first) and not just $first
like in 
>HTHML.
>Somewhere between 
>$sql = "INSERT INTO employees (first,last,address,position)
> > VALUES ('$(first)','$(last)','$(address)','$(position)')";
>
>AND
> > $result = mysql_db_query ("mydb", $sql);
>it seemes to loose the values of all my variables!!
>I would appreciate any help anyone can be since I have been working in this 
>for 2 days solid now and haven't managed to fix it (though i have managed to 
>recreate it in many different ways!!)

WML variables are not PHP variables.  The way I do this is to have get the
input in a card
like you have it then submit it to another php script that processes it just
like it would process any form data submitted.  Doing it this way they all
end up as regular php variables.

For example, gather all your data as you have it, but instead of sending it to
another card where you process it send it to a php script which handles it.
 This
script need not even be wap compliant, it can just process and that's it,
but you'd
probably want it to be to confirm that it did what it did.  In your case, 




 



where myurl is the url to a script which contains something like:

\n");
  echo("http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n");
  echo("\n");
?>



 
  
 
';
?>





=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


-- 
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] WML and PHP AND mysql

2001-02-08 Thread Andrew Apold

At 11:06 AM 2/8/01 -, Kato Strandjord wrote:
>Author: Kato Strandjord (katos.tihlde.org)
>Date:   06/02/2001 15:41
>
>I use apache server on win2000, php4, mysql and wml which I test local on my
>harddrive.
>
>The code under is working fine when I test it on emulators like UP SDK from
>phone.com. or other, but i have fooled it to use static variables which is
>not the solution i want.
>My problem is. How can I use my variable:
>print "";
>in this code under so that I can use its value in my php function:
>$tabfag=finnMeldinger($fagnr);
>I can see the WML variable if i print it out in WML, but i can not print it
>out as a variable in PHP. I have fooled the php function and put a static
>variable in it, instead of the dynamic WML variable, which is generated from
>a select list. I have tried for a week but al kinds of tricks did not work.
>At one time i got the value from WML to PHP, but it came out like this
>"=so480". The sign = was impossible to remove, so i could not use it. The
>correct value is "so480" with out the "="

once its in php, you can't just substr the part you want?

FWIW, I usually ended up calling seperate wml scripts (not cards) and passing
variables via get...


=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


-- 
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] double "posts"

2001-02-16 Thread Andrew Apold

At 12:53 PM 2/16/01 -0800, Marc Bragg wrote:
>
>Is it possible to post to two forms with one click, one post command?
>What would statement look like?

I've long wanted to do this but never found something to do it.  Usually
it is for something where I am submitting it to someone else but want to
keep what I submitted.  Thus far I make do by sending it to a page of 
mine, which saves it in my database, then sends it on again via hidden
fields to the end place.  It does require an extra click from the user,
though...

If there is a way to do this I'd be interested but I haven't found one...

=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


-- 
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] MySQL database transfer

2001-02-21 Thread Andrew Apold

At 03:24 AM 2/22/01 -, Sridhar Ranganathan wrote:
>Hi
>
>I have mysql on linux and windows on the same machine. How do i transfer 
>data between them??

use mysql dump to create a script, .sql file, and execute it on the other one.


=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


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

2001-02-24 Thread Andrew Apold

At 11:31 PM 2/24/01 -0500, Nicholas W. Miller wrote:
>I am developing a shopping cart style e-commerce web site.   I have a 
>table called carts that holds users' cart items ... so one user may 
>have several entries in this table:
>
>++--+--+-+-+---+
>| Field  | Type | Null | Key | Default | Extra |
>++--+--+-+-+---+
>| cust_id| int(11)  |  | | 0   |   |
>| item_id| int(11)  | YES  | | NULL|   |
>| qty| tinyint(4)   | YES  | | NULL|   |
>| price | float(10,2)  | YES  | | NULL|   |
>| date_added | timestamp(6) | YES  | | NULL|   |
>++--+--+-+-+---+
>
>I would like to write a PHP script that I will cron which will delete 
>all items belonging to a user if their most recent item is over 90 
>days old.
>
>Is this possible?

What database?  Assuming an sql type you do a select custid, max(date_added)
(I do most my dates as just ints of unix timestamps) group by custid having
max(date_added) > (timestamp of 90 days ago).  as you select them call a 
function that passes custids that come up, and the function deletes where
custid = thevaluepassed.


=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


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

2001-03-04 Thread Andrew Apold

At 12:58 PM 3/4/01 +0100, Joris Kluivers wrote:
>hi,
>
>i have a problem
>i have a database table created with the statement:
>CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL
AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id);
>
>I insert records with:
>INSERT INTO chatmessages (message, username) VALUES ('$message', '$username')
>
>this works fine (for a while), i can insert messages and retreive them
with php.
>But after some time i get the error:
>ERROR 1062: Duplicate entry '127' for key 1
>but how can this be because i've set it to AUTO_INCREMENT.
>
>can someone help me?
>thanks in advance


Don't use tinyint.  It only allows 128 values (0 to 127).  Any values
larger than 127 will go in as 127.

Try smallint or int.Sounds like phpadmin, it defaults variables as
tinyint


=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


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