|
|
|
|
![]() ![]() |
Feb 1 2007, 01:12 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 57 Joined: 23-January 07 Member No.: 37,683 |
I need help with a couple of things.
First, I need to know how to retrieve information from a mysql database and edit it then re add it to the database. I also would like to know how to easily delete a mysql row. And I want this done without going to phpMyAdmin. Thanks for the help! |
|
|
|
Feb 1 2007, 01:45 AM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,880 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
It will require some server-side coding. Php is commonly used.
Here is a link to a previous topic which deals with the delete aspect. http://www.trap17.com/forums/how-delete-ro...sql-t43451.html Hope this helps. |
|
|
|
Feb 1 2007, 01:48 AM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 57 Joined: 23-January 07 Member No.: 37,683 |
Well. I did that thread and for some reason I can't understand it...
Btw, I know it uses PHP and Mysql. |
|
|
|
Feb 1 2007, 03:33 PM
Post
#4
|
|
|
A clever man learns from his own mistakes, a WISE man learns from those of OTHERS ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 884 Joined: 12-April 06 From: Essex, UK Member No.: 21,719 |
Hey there, for a basic example of UPDATE check this: http://www.tizag.com/mysqlTutorial/mysqlupdate.php
If you click on the "next" link then youll see an example of delete also. i think its worth expanding on this part though: QUOTE // Get Sandy's record from the "example" table $result = mysql_query("UPDATE example SET age='22' WHERE age='21'") or die(mysql_error()); i dont like the WHERE part of this example so let me show how i would explain... we will assume that there is a table of say usernames and passwords called "users" and a user wants to change their password. So of course they login and put the new password and click a button to change their password. the php code to edit the field "password" in the DB and change it to their new password would be like this assuming their username is "bob" and their old password was "bobspass" and their new password is "bobnew": CODE $result = mysql_query("UPDATE users SET password='bobnew' WHERE username='bob'") or die(mysql_error()); simple the syntax for update is: CODE UPDATE table_name SET field_name='New_value' WHERE field_name='Old_value' and DELETE is: CODE DELETE FROM table_name WHERE field_name='a_value' If you need help with connecting to the database etc just ask and we will be glad to help. I wont post it now but if you need any more help just ask! |
|
|
|
Feb 2 2007, 02:02 AM
Post
#5
|
|
|
$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 6,305 Joined: 21-September 04 From: 9r33|\| 399$ 4|\|D 5P4/\/\ Member No.: 1,218 ![]() |
I know I have seen several tutorials on pixel2life about adding tables and info, can't think of the links of the top of my head but I have some others, I know posts some links about mysql db's but have to look for it later and let you know.
|
|
|
|
Feb 2 2007, 05:09 AM
Post
#6
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 57 Joined: 23-January 07 Member No.: 37,683 |
Well, I got the delete thing to work. I will add edit at a later time. Thanks for the help.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 09:45 AM |