i can't belive i can't get this...
Posted: Thu Sep 05, 2002 12:00 pm
...
What i am doing is displaying a list of admins from a database:
Above, in the last tabledata tag i have tried to add in a delete query right into my page so i don't have to goto phpMyAdmin when i want to delete another admin. I am not sure that is the proper formation for it so if i got it wrong can anyone correct me?
Back to the main problem..
for this line:
where it says "id", i have tried every variable i could think of and even in the blank variable beside it, i tried all sorts of combinations, yet no luck.
Currently all the page displays is this:
can anyone help me out here?
What i am doing is displaying a list of admins from a database:
Code: Select all
<?
mysql_connect("localhost","","");
mysql_select_db("");
$a=mysql_query("select * from members order by id");
echo "<table width=30% bgcolor=#EFEFEF align=center border=1 bordercolor=black>\n";
while($admin=mysql_fetch_array($a)){
echo "<tr align=center>\n";
echo "<td align=left><font size=1><strong>ID</strong>";
echo "<td align=left><font size=1><strong>Name</strong>";
echo "<td align=left><font size=1><strong>Username</strong>";
echo "<td align=left><font size=1><strong>Email</strong>";
echo "<td align=left><font size=1><strong>Delete?</strong>";
echo "</tr>";
echo "<tr align=center>\n";
echo "<td align=left><font size=1><br>$adminїid]";
echo "<td align=left><font size=1><br>$adminїname]";
echo "<td align=left><font size=1><br>$adminїlogin]";
echo "<td align=left><font size=1><br><a href=mailto:$adminїemail]>$adminїemail]</a>";
echo "<td align=left><font size=1>
<form action=administration.php method=post>
<input type=hidden value=$adminїid]>
<input name=Delete type=submit value=Delete>
</form>";
}
?>Back to the main problem..
Code: Select all
<?
if ($Delete) {
$db=mysql_connect("localhost","") or die ("cant connect");
mysql_select_db("",$db) or die ("cant change");
$result=mysql_query("delete from members where id='$adminїid]'") or die ("</tr></table><br><br>Deletion <b>NOT</b> Successful!");
while ($row=mysql_fetch_array($result)) {
if ($rowї"id"]==""]) {
printf("</tr></table><br><br>Successfully Deleted!");
}
}
}
?>Code: Select all
if ($rowї"id"]==""]) {Currently all the page displays is this:
46 is that line i highlighted btw...Parse error: parse error in C:\apache\htdocs\x\x\x.php on line 46
can anyone help me out here?