Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Servers
Reload this Page NEW MYSQL user
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Servers Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Reply
 
Thread Tools Display Modes
Old 05-11-2008   #1 (permalink)
unclesirbobby
Just Joined!
 
Join Date: May 2008
Posts: 12
NEW MYSQL user

I am learning mysql. Its a difficult language to get my head round. Is it right that everything has to be done using mysql statements eg select,update, delete

I am having difficulty working out how to do certain complex operations. Is it OK to do the following. You set up a SELECT which loops through records . But within the loop you place specific UPDATES.

Also if I wanted to update a specific record going by the actual record number... eg the simple sequential number. How would I refer to that in mysql.
__________________
http://www.unclesirbobby.org.uk
unclesirbobby is offline   Reply With Quote
Old 05-11-2008   #2 (permalink)
bobescalin2005
Linux Newbie
 
bobescalin2005's Avatar
 
Join Date: Oct 2005
Location: Romania
Posts: 109
You can start from here
Cheers!
__________________
Registered Linux user #471256
http://counter.li.org
Don`t give up so easy...
calin
bobescalin2005 is offline   Reply With Quote
Old 05-11-2008   #3 (permalink)
bigtomrodney
Bigtomrodinator
 
bigtomrodney's Avatar
 
Join Date: Nov 2004
Location: Sunny South-East of Ireland
Posts: 4,790
Well there's a couple of things to get you started. First off, the language is SQL and MySQL is a product which uses this language. That should help when searching for resources on it. You should check out RDBMS principles in general before you attempt to learn the language. Some of the functions won't make any sense until you understand how tables relate, primary/foreign keys etc.

With regards to your question about selecting and then updating...it's best not to think of things in such a linear way. SQL is quite advanced and isn't your usual shopping-list basic scripting. Why select and the update? Why not use the where condition to specify what you want updated?
Code:
update address_table set post_code = 'AA11AA' where line_4 like '%dublin%'
Your reference to index numbers....well you're halfway on the right track. Don't depend on a random index. Look at the data you have and try to find a key. Say for instance if it was bills and invoices, you could use the invoice number. If it was customers, it could be a customer number. Hell it could even be a firstname or surname if you found it to be suitable and an individual idea.

As I said above it's really a subject you should get a good feeling for and understanding of relational databases before jumping in. The hello_world of SQL doesn't even scratch the surface
bigtomrodney is offline   Reply With Quote
Old 05-11-2008   #4 (permalink)
jledhead
Linux Enthusiast
 
jledhead's Avatar
 
Join Date: Oct 2004
Location: North Carolina
Posts: 746
I also prefer phpmyadmin for my interface to mysql.
jledhead is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 11:16 PM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0