panth
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by panth
-
-
I personally like working with echo rather with <? ?> each time i want to enter HTML code in your first script not in delete_notice.php
as for the delete_notice.php script for debuging i\'d always rather use mysql_error() instead of text in \'or die( )\' part
this will give you a main idea why you have problems
if you still can\'t solve it
come to here and paste what the problems are...
original code :
$id = $_POST[\'id\']; $link = mysql_connect("localhost", $dbuser, $dbpass) or die ("Database Error: Couldn\'t Connect!"); mysql_select_db($dbname, $link) or die ("Couldn\'t open $dbname!"); $query = "DELETE FROM notices WHERE \'id\' = \'$id\' "; mysql_query($query, $link) or die ("Couldn\'t delete data!"); mysql_close($link); include "header.php"; print \'<center>\'; print \'<br>\'; print \'Notice(s) succesfully deleted\'; print \'<br>\'; print \'<a href="noticeadmin.php">Return to Notices Administration</a>\'; print \'<center>\';
change into
$id = $_POST[\'id\']; $link = mysql_connect("localhost", $dbuser, $dbpass) or die (mysql_error()); mysql_select_db($dbname, $link) or die (mysql_error()); $query = "DELETE FROM notices WHERE \'id\' = \'$id\' "; mysql_query($query, $link) or die (mysql_error()); mysql_close($link); include "header.php"; print \'<center>\'; print \'<br>\'; print \'Notice(s) succesfully deleted\'; print \'<br>\'; print \'<a href="noticeadmin.php">Return to Notices Administration</a>\'; print \'<center>\';
-
Let\'s say I want to add a IRC channel into a database
the irc chan is #we\'re-lost
what do i need to do to have the \' not f****** my database
(INSERT INTO somewhere VALUES (irc) \'We\'re-lost\')
What do I need to make it work?
help with a php/mysql news script
in MySQL Help
Posted
Try do it with links and $_GET instead of $_POST
it\'ll work