For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2008 > problem in recorset that seems temporary









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem in recorset that seems temporary
Ruprecht Helms

2008-01-25, 7:05 pm

Hi,

I have a problem that confuse me a little bit. When I want to delete a
picture by giving the id-value in the URL I get the following error:

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL
result resource in
/opt/lampp/htdocs/pferdeservice_karle/galerie_delete.php on line 81


On clicking the relodebutton on the browser I get no error and the
deletion of the recordset seems to be not executed. When I don't reload
the page and change to view the pictureresults the recordset have been
deleted. But I don't know why I get the warning-message.

Attached the code.

Regards,
Ruprecht
http://www.rheyn.de

----------------------------------------------------


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title></title>
<meta name="GENERATOR" content="Quanta Plus">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
a:link { color:#FF0000;
font-family:Arial,Helvetica,Verdana,Sans-serif;font-size:9pt;
font-weight:bold;text-decoration:none;}
a:visited { color:#CC340A;
font-family:Arial,Helvetica,Verdana,Sans-serif;font-size:9pt;
font-weight:bold;text-decoration:none;}
a:active { color:#FFCC00;
font-family:Arial,Helvetica,Verdana,Sans-serif;font-size:9pt;
font-style:italic; font-weight:bold;text-decoration:none;}
a:hover { color:#FF9900;
font-family:Arial,Helvetica,Verdana,Sans-serif;font-size:9pt;
font-weight:bold;text-decoration:none;}
td { color:#000000; font-family:Arial,Helvetica,Verdana,Sans-serif;
font-size:9pt;font-weight:plain;}
h2 { color:#000000; font-family:,Helvetica,Verdana,Sans-serif;
font-size:12pt; font-weight:bold;}
h4 { color:#FFFFFF; font-family:Arial,Helvetica,Verdana,Sans-serif;
font-size:10pt; line-height:12pt; font-weight:bold;}
h1 {
color:#444444;
margin-top:1em;
font-size: 1.4em;
font-weight: bold;
}
body{
text-align:center;
background-color:#F0F0F0;
font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size:0.78em;
}
</style>
<body>
<table>
<tbody>
<TR>
<TD bgcolor="#dddddd">

<table height="780" width="200" align="center"><TR><TD>
<table width="80%" align="center" style="border-bottom-color : #ffffff;
border-left-color : #ffffff; border-right-color : #ffffff;
border-spacing : 10px; border-top-color : #ffffff;">
<tbody>
<TR>
<TD width="200" bgcolor="#f0f0f0"><h2>Bildergalerie</h2>
<A href="galerie_zeigen.php">Galeriebilder zeigen</A>
<A href="galerie_add_neu.php">Galeriebild hinzufügen</A><br>
<A href="galerie_update.php">Galeriebild aktualisieren</A><br>
</TD>
</TR>
<tr>
<td bgcolor="#f0f0f0"><h2>Quicklinks</h2>
<A href="springpferde_zeigen.php">Springpferde</A>
<A href="dressurpferde_zeigen.php">Dressurpferde</A><br>
FAQ

</td>
</tr>
<tr>
<td bgcolor="#f0f0f0"><h2>News</h2>
<A href="news_zeigen.php">News zeigen</A></A><br>
<A href="news_add0.php">News hinzufügen</A><br>
News bearbeiten<br>
News löschen
</td>
</tr>
</tbody>
</table>


</TD></TR></table>


</TD>
<td valign="top">
<h1 align="left">Galerie löschen</h1>
<?
mysql_connect("localhost","root");

$result=mysql_db_query("pferdeservice-karle","SELECT * FROM Galerie
WHERE ID=$id");

$zahl = mysql_num_rows($result);
echo "Zahl vorhandener Bilder ".$zahl;
echo mysql_error();

while($row = mysql_fetch_object($result))
{
$galerie_id=$row->ID;
$result=mysql_db_query("pferdeservice-karle","DELETE FROM
Galerie_kultur WHERE GalerieID=$id");
}
$result=mysql_db_query("pferdeservice-karle","DELETE FROM Galerie WHERE
ID=$id");
echo mysql_error();
?>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com