MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 25th, 2004, 10:09 AM
Seriousdamage Seriousdamage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 7 Seriousdamage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 37 sec
Reputation Power: 0
Delete Record

Hi Again, now that I have created the Search page on my database, I would like to be able
to search for a record and then select one or more records from the list that the search gave me and delete them.
How can I do this?

The database online if here :
http://www.giustinianinicola.com/php/display.php

Below is the Search script.

<?php
if ($search) // perform search only if a string was entered.
{
mysql_connect("localhost","***","***"); // servername = localhost, username for the database, password
$db = "database"; //database name
$srch="%".$search."%";
$query = "select * from ISSUE WHERE id LIKE '$srch' || name LIKE '$srch' || surname LIKE '$srch' || phone LIKE '$srch' || status LIKE '$srch'";
$result = mysql_db_query("database", $query) or die("MySQL ERROR #".mysql_errno().": ".mysql_error());
if ($result)
{
echo "<font face='Tahoma' size=2><b>Here are the results:</b></font><br><br>";
echo "<table border=0 cellpadding=3 cellspacing=5>
<tr bgcolor=#104E8B>
<td width=10><font size=2 color=#FFFF00 face=tahoma><b>ID</b></font></td>
<td width=80><font size=2 color=#FFFF00 face=tahoma><b>First Name</b></font></td>
<td width=100><font size=2 color=#FFFF00 face=tahoma><b>Last Name</b></font></td>
<td width=50><font size=2 color=#FFFF00 face=tahoma><b>Phone</b></font></td>
<td width=50><font size=2 color=#FFFF00 face=tahoma><b>Status</b></font></td>
</tr>";

//while ($r = mysql_fetch_array($result)) { // Begin while
while ($r = mysql_fetch_array($result)) { // Begin while
$id = $r["id"];
$name = $r["name"];
$surname = $r["surname"];
$phone = $r["phone"];
$status = $r["status"];
echo "<tr bgcolor=669966>
<td align=left><font color='#ffffff'>$id</font></td>
<td align=left><font color='#ffffff'>$name</font></td>
<td align=left><font color='#ffffff'>$surname</font></td>
<td align=left><font color='#ffffff'>$phone</font></td>
<td align=left><font color='#ffffff'>$status</font></td>
</tr>";
} // end while
echo "</table>";
}
} else {
echo "Search string is empty. <br> Go back and type a string to search";
}
?>


If you need more information please let me know.
Thanks a lot

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Delete Record


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway