User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,627 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,794 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3131 | Replies: 5
Reply
Join Date: Jun 2004
Posts: 5
Reputation: astm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
astm astm is offline Offline
Newbie Poster

Help How can i deledet and update from table ???????

  #1  
Jun 27th, 2004
please

iam ask about

how can i delete and update from table ?

please i want example to delete data from table

and aother example to make update data from table

please help me :o
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

Re: How can i deledet and update from table ???????

  #2  
Jun 27th, 2004
I use mysql... so in mysql its...
$sql = "DELETE FROM table WHERE field='value'";

or

$sql = "UPDATE table SET field='value' WHERE ...";

mysql_query($sql);

this is more of a basic SQL question then php...
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: How can i deledet and update from table ???????

  #3  
Jun 27th, 2004
I think he wants to know how to do it via php...
Formerly known as Slade.
Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 743
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: How can i deledet and update from table ???????

  #4  
Jun 28th, 2004
Originally Posted by slade
I think he wants to know how to do it via php...

that is how you do it. it would be

<?php

mysql_connect (mysql location, username, password) or die(mysql_error());
$tb_delete = "DELETE FROM tabl WHERE field='value'";
mysql_query($tb_delete) or die(mysql_error());

mysql_close();

that would be most of the code that you would see, or part of it.
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Join Date: Jun 2004
Posts: 5
Reputation: astm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
astm astm is offline Offline
Newbie Poster

Re: How can i deledet and update from table ???????

  #5  
Jun 29th, 2004
thank you Killer_Typo


now i want to now how i can make update
Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 743
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: How can i deledet and update from table ???????

  #6  
Jun 29th, 2004
Originally Posted by astm
thank you Killer_Typo


now i want to now how i can make update

should be around the same as what i said before, but use the UPDATE syntax. if you open up the mysql manual and do a search by going to edit, find on page. and type in the word you will most likely find all of the information you need to know about correct mysql syntax.


also i forgot to to mention that in the code that i listed above i forgot to add the line for selecting the correct databse. wich would be

$use = "USE database";

mysql_query($use) or die(mysql_error());

somthing along those lines should select the databse for the table you wish to modify (ive been writing my own custom database management tool, so ive been trying to get good with mysql syntax)
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 12:48 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC