MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL 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 Dev Shed Forums Sponsor:
  #1  
Old August 22nd, 2000, 03:02 PM
gwynbleidd gwynbleidd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 2 gwynbleidd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to gwynbleidd
Well hiya ppl URL I am studying to interact with MySQL bases using PHP 4. The problem is as follows: I need to use Update after editing a particular record. But I also need to supply a parameter to WHERE which would specify which record to update. So the question is is there any function in MySQL which handles the number of row(record)? so that I could use mysql_query("UPDATE mytable SET field1=var1, field2=var2 WHERE RECNO()=var3") but instead of RECNO was the function I'm asking about HUGE thanks in advance URL

Reply With Quote
  #2  
Old August 23rd, 2000, 05:15 AM
christucker2 christucker2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 81 christucker2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
As far as I know, no, MySQL doesn't maintain a row id to allow you to specify which record you wish to change. Anyway, that's a bad way to do it as there's no promise in a relational DB that there is any order to the data returned -- the third row returned could be 479th row entered (it probably won't be, but it _could_ be).

What you want to do is specify which row you want to update using some candidate (unique) key (probably the primary key, though only unique key would work). If you want to record the order you insert rows, add an auto_increment column to the table.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Is there any function in MySQL like RECNO()?


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 5 hosted by Hostway