Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 19th, 2002, 04:49 AM
DrSpin DrSpin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: LC, NM 88001
Posts: 2 DrSpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using PHP- running BASIC mySQL script

I need to run this code in a PHP document to copy a record from one table to another... I also need to find out how to select the LAST RECORD in the table.

INSERT INTO `ruidoso_ActionSki`.`0203`
SELECT ???lastRecord???
FROM `ruidoso_ActionSki`.`Reservations`

ANY HELP WOULD BE APPRECIATED

Thanks COLE

Reply With Quote
  #2  
Old December 19th, 2002, 02:59 PM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Using PHP- running BASIC mySQL script

proper syntax is

$query="INSERT INTO table_name VALUES ('value1','value2')";
$result=mysql_query($query)or die(error message);


once that is inserted you can use
$last_id=mysql_insert_id($result);



Reply With Quote
  #3  
Old December 19th, 2002, 03:38 PM
DrSpin DrSpin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: LC, NM 88001
Posts: 2 DrSpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Using PHP- running BASIC mySQL script

Thanks worked like a charm - I guess that I should just read the docs to figure out how to move to the last record with the SQL

THANKS!!

Cole

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Using PHP- running BASIC mySQL script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway