Re: [PHP] Move data from one MySql table to another?

2001-03-23 Thread darion mapp

i know what you are trying to do i have done it before, just don't quite remember how 
i solved the problem, but i think what i did was to create the move link with the id 
of the field that you want to move, then another php file will do the stuff:

1. using the insert with the select statment you will be able to insert the row into 
the new table using the id in the where clause of the select section.

2. check to ensure that the data was inserted

3. delete from oldtable where id = id passed from previous page

4. return the user to the page so that they can see that the row is no longer there.
--

On Fri, 23 Mar 2001 11:19:34  
 YoBro wrote:
Hello,

Does anybody know where I could find out how to Move data from one Mysql
table to another.

I have a query showing all the results, and I am trying to put a link at the
end of each row that says "move"

Clicking this will move that records information to another table.
IE From table orders to table ordered

Make sense?

Please help

--
Regards,


YoBro
-
DO NOT REPLY TO THIS VIA EMAIL
PLEASE USE THE NEWSGROUP
All emails sent to this address are automatically deleted.
This is to avoid SPAM!
-



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




Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

-- 
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] Move data from one MySql table to another?

2001-03-23 Thread darion mapp

NO it is not possible to use subselects at this point BUT It is possible to insert via 
a select check the mysql site for the insert syntax
--

On Fri, 23 Mar 2001 12:41:04  
 Boget, Chris wrote:
 To populate new_table from old_table you can give it this SQL:
 INSERT INTO new_table (name, address) VALUES SELECT name, address FROM
 old_table;

Umm, I didn't think you could do subselects in MySQL?
Or am I missing something?

Chris



Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

-- 
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] Move data from one MySql table to another?

2001-03-23 Thread darion mapp

NO it is not possible to use subselects at this point BUT It is possible to insert via 
a select check the mysql site for the insert syntax
--

On Fri, 23 Mar 2001 12:41:04  
 Boget, Chris wrote:
 To populate new_table from old_table you can give it this SQL:
 INSERT INTO new_table (name, address) VALUES SELECT name, address FROM
 old_table;

Umm, I didn't think you could do subselects in MySQL?
Or am I missing something?

Chris



Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

-- 
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] Move data from one MySql table to another?

2001-03-23 Thread darion mapp

Remove the "values" in your sql and see




--

On Fri, 23 Mar 2001 13:00:23  
 Boget, Chris wrote:
 MySQL only supports INSERT ... SELECT ... and REPLACE ... SELECT ...
 Independent sub-selects will probably be available in Version 
 4.0. You can now use the function IN() in other contexts, however. 

I tried the query in the original post and I could not get it to work.
This is what I got:

mysql insert into new_names (name, email) values select name, email from 
old_names;
ERROR 1064: You have an error in your SQL syntax near 'select name, email 
from old_names' at line 1

What's going wrong if this is supposed to work?
I'm using mySQL 3.22.32

Chris



Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

-- 
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] Complex IF statement

2001-03-23 Thread darion mapp

try
if($var = "duck" || $var = "goose"){}else{}

now you should look into the switch-case function also
--

On Wed, 13 Dec 2000 00:19:08  
 JCampbell wrote:
Thank you all for your help earlier!

Now I need to know if it is possible to create a complex if statement?

if ($variable=="duck") || ($variable=="goose"){ }else{ }

Is how I thought it would work. I just need to know if there is an easy way
to do an OR in if statements IF variable equals duck or goose...

Jon
===
And shepards we shall be
For thee, my lord, for thee
For thou hath descended forth from thy hands
That our feats may swiftly carry out thy command
We will flow a river forth unto thee
And teaming with souls shall it ever be...
===
http://jcampbell.blacklightning.net


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




Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

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

2001-03-22 Thread darion mapp

why don't you check to see is a variable was passed to the page. If you use the post 
method then a hidden field can be used o check that the user did come from the 
application page.

a sample of the check will be

if(!$var_from_previous_page)
{
header("location: application.php");
}

--

On Thu, 22 Mar 2001 14:34:21  
 Good Fella wrote:
Hi All,

I currently have a small problem with my PHP form.  I have made two PHP 
files (application.php and process_application.php).

On submitting the form, you then move to process_application.php.  Any 
errors will force the form NOT to be submitted to me.

However, how do I stop people from accessing process_application.php 
directly?  You can still type in the URL of this address without filling in 
any details.

Although it serves up an error, is there anyway I can prevent people from 
getting to this page unless they press "Submit" on the actual form on 
application.php?

Thanks,

SK
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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




Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

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

2001-03-22 Thread darion mapp

ok, so i have want to encrypt my user password in the mySQL Database and well that is 
not working but in addition to that when the user logges into the system i have to 
encrypt their password and compare the two encrypted passwords to see if they match. 
this is where my problem starts. I get the same error for both the registration 
process where the password is encrypted to be placed into the database and when the 
use logs in and the password is encrypted to be compared.

The web browser errors to "Page cannot bbe displayed (IE)" and only when the line 
below is commented out does it work fine.

HELP Project was due last week so i am pressed for time

$txtPass = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $txtPass, MCRYPT_ENCRYPT);


Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

-- 
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] Printing MySQL into HTML Tables

2001-03-22 Thread darion mapp

now it seems like you know what is to be done and you are not willing to do the work. 
Now i have not tested this and you may have to do some work with it but you get the 
picture. if you lookup the syntax and ensure how to use the command then you will be 
ok.
of course if you still have problems then let em know


FOR($i = 0;$i  $numrows; ++$i)
{
echo"trtd$mysql_result($resultidentiferfromquery, $i, 
fieldwithproduct)/tdtd$mysql_result($resultidentiferfromquery, ++$i, 
fieldwithproduct)/td/tr";
echo"trtd$mysql_result($resultidentiferfromquery, ++$i, 
fieldwithproduct)/tdtdnbsp;/td/tr";
if($i/2  0) //not even
{
echo"trtdnbsp;/tdtdnbsp;/td/tr";
}
}

 
--

On Thu, 22 Mar 2001 15:19:09  
 Jeff Oien wrote:
I would like to do this with a MySQL database containing
product information:

trtdProduct 1 Info/tdtdProduct 2 Info/td/tr
trtdProduct 3 Info/tdtd /td/tr

And if there are an odd number of products I want it to 
complete the table row with nothing in the cell. I want
it to be able to automatically do this no matter how many
products there are. I'm not sure how to set it up to 
print every other like that.
Jeff Oien

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




Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

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