943,630 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 5800
  • PHP RSS
Jun 27th, 2004
0

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

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astm is offline Offline
5 posts
since Jun 2004
Jun 27th, 2004
0

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

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...
Reputation Points: 15
Solved Threads: 10
Unverified User
BinaryMayhem is offline Offline
173 posts
since Jun 2004
Jun 28th, 2004
0

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

I think he wants to know how to do it via php...
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
Jun 28th, 2004
0

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

Quote 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.
Reputation Points: 152
Solved Threads: 39
Master Poster
Killer_Typo is offline Offline
778 posts
since Apr 2004
Jun 29th, 2004
0

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

thank you Killer_Typo


now i want to now how i can make update
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astm is offline Offline
5 posts
since Jun 2004
Jun 29th, 2004
0

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

Quote 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)
Reputation Points: 152
Solved Threads: 39
Master Poster
Killer_Typo is offline Offline
778 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Problem Unsetting Variables?
Next Thread in PHP Forum Timeline: Code Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC