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

Reply

Join Date: Jun 2004
Posts: 5
Reputation: astm is an unknown quantity at this point 
Solved Threads: 0
astm astm is offline Offline
Newbie Poster

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

 
0
  #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
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

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

 
0
  #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 Quick reply to this message  
Join Date: Mar 2004
Posts: 634
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Solved Threads: 7
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

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

 
0
  #3
Jun 28th, 2004
I think he wants to know how to do it via php...
Formerly known as Slade.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

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

 
0
  #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.
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 5
Reputation: astm is an unknown quantity at this point 
Solved Threads: 0
astm astm is offline Offline
Newbie Poster

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

 
0
  #5
Jun 29th, 2004
thank you Killer_Typo


now i want to now how i can make update
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

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

 
0
  #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)
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC