/[health_html]/inc/newsDelete.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /inc/newsDelete.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Tue Oct 23 16:13:59 2001 UTC (22 years, 5 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -0 lines
Added an author's CV. Added a secondary main article. Added the Related fields to news editor, and also fixed some bugs in it. Other bugfixes and improvements.

1 <?php
2 function newsDelete($id) {
3 if (!$id) return;
4 global $dbh, $syspicdir;
5 $sql = "SELECT pic FROM paragraphs WHERE (news_id = $id)";
6 $sth = $dbh->prepare($sql);
7 if (!$sth) error("Cannot prepare query: \"$sql\"");
8 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
9 while ($row = $sth->fetchrow_array()) MyDelete($syspicdir."/".$row[0]);
10 $sth->finish();
11 $sql = "DELETE FROM related WHERE (news_id = $id)";
12 $dbh->dbh_do($sql);
13 $sql = "DELETE FROM paragraphs WHERE (news_id = $id)";
14 $dbh->dbh_do($sql);
15 $sql = "SELECT title_pic FROM news WHERE (news_id = $id)";
16 $sth = $dbh->prepare($sql);
17 if (!$sth) error("Cannot prepare query: \"$sql\"");
18 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
19 while ($row = $sth->fetchrow_array()) MyDelete($syspicdir."/".$row[0]);
20 $sth->finish();
21 $sql = "DELETE FROM cat_news WHERE (news_id = $id)";
22 $dbh->dbh_do($sql);
23 $sql = "DELETE FROM spec_news WHERE (news_id = $id)";
24 $dbh->dbh_do($sql);
25 $sql = "DELETE FROM news WHERE (news_id = $id)";
26 $dbh->dbh_do($sql);
27 }
28 ?>

  ViewVC Help
Powered by ViewVC 1.1.26