Sorry if its confusing but here is whats going on: I have a table in a database called comments and there are alot of entries there but can manually be marked flagged with a 1. nevermind how that is done, but I made it so the comments are printed on a pass protected page with two links below them. Ignore is supposed to mark that comment with a 0, and delete deletes the row.
Everything works fine but the action happens to ALL the comments that are shown. Can anyone see why that is happening?
Code: <?
if($session->isAdmin()){?>
<center><font face="Papyrus" size="5">MOD Center</font></center>
<center><a href='mod1.php'>[News Aproval]</a> <a href='mod2.php'>[Flagged Items]</a></center>
<?$con = mysql_connect("localhost","bmvybfbk_master","74SAc194G");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("bmvybfbk_website", $con);
$result = mysql_query("SELECT * FROM comments WHERE flagged = '1'");
while($row = mysql_fetch_array($result))
{
$cnumber = $row['id'];
echo $row['writer'] . " wrote:
" . $row['comment'];
echo "
<a href='mod2.php?action=ignore'>[Ignore]</a>";
echo " <a href='mod2.php?action=delcomment'>[Delete]</a>";
echo "
----------------------------------------------------------------------------------------------------
";
if ($action == ignore) {
mysql_query("UPDATE comments SET flagged = '0' WHERE id = '$cnumber' LIMIT 1");}
if ($action == delcomment) {mysql_query("DELETE FROM comments WHERE id='$cnumber' LIMIT1");}
else {echo " ";}
}
}else{ echo "*You Don't Have any rights to View this page*'"; } ?>
Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.I have images like this:and:Obv I have an image for each day of the month (1 - 31) and I have images for each month.if i created a
SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built in???
Sub-domains & calling unique content
Hello,Is there a way use something similar to the $_GET function for a sub-domain? I to be able to have my sub-domains all use the root directory, but have information filtered for a specific
The control with ID 'ace' requires a ScriptManager on the page
I'm trying to add a simple AlwaysVisibleControlExtender to my page, but it's not working. I get the following error:The control with ID 'ace' requires a ScriptManager on the page. The
mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily MySQL, we used the Microsoft variety in school). I have a weird problem, I'm trying to create a
Blocking video streaming
Hello everyone,I post a message here because i didn't find any solution yet.I just finished video streaming service on my website. I use xmoov script (http://xmoov.com/xmoov-php/) to do that. It works
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.Some code runs as perfectly valid code, where i would like PHP to issue a warning / error.I guess this is because of the loose typing of PHP,
PHP Thumbnail Creation
Ok so i use this function to create thumbnails:Code: function createthumb($name,$filename,$new_w,$new_h){ $system=explode('.',$name); $src_img=imagecreatefrompng($name);
this code is strange !
Hi i got this code from the web.. It checks for live and dead socksIt is working perfectly on my localhost. but does not work in any webserver ! any ideas ?<?php$filename =
webpage with (simple) login & mysql-db
Hi all,What I was looking for before was a multi-user password manager, web-based! The offer of free or cheap tools of this kind is very pover. Or they are too complex (or too expensive)I'm not