Re: Why won`t this delete?
| From: | Julie Meloni | Date: | Fri, 27 Oct 2000 22:35:37 +0000 |
| Subject: | Re: Why won`t this delete? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22385@lists.php.net to get a copy of this message | ||
Not really...escaped double-quotes work just fine.
Check to see that the value of $Email really _is_ something. echo the SQL statement and try the query by hand. If the script is not die()-ing, then quite likely the value of $Email isn't anything that matches. Check, in the form that precedes it, that the name of the input field is Email and not email ... case makes a difference.
Dallas Kropka wrote:
Um... try this.
$Updstmt="delete from EList1 where Email= '$Email' ";
mysql_query($updstmt);
its the single quotes that make a diff.
----- Original Message -----
From: <Website4S@aol.com>
To: <php-general@lists.php.net>
Sent: Friday, October 27, 2000 9:19 AM
Subject: [PHP] Why won`t this delete?
Hi,
I have a basic if statement but for some reason it just won`t delete, any
ideas what I`ve done wrong? I have a table called EList1 which has one
field
called Email varchar(50) I know the form is working ok because it allows
me
to add but not remove.
if ($Selection=="unsubscribe"){
$Updstmt="delete from EList1 where Email=\"$Email\"";
$SQLConn = mysql_connect("", "", "") or die ("Could not connect to
database");
$db = mysql_select_db("f199102", $SQLConn) or die ("Couldn`t select
database");
$query_delete=mysql_db_query($db, $Updstmt);
if (!$query_delete){
echo "Couldn`t Delete";
}
mysql_close ($SQLConn);
printf("<SCRIPT LANGUAGE='JAVASCRIPT'>alert('You have been removed from
the mailing list.');self.history.back();</SCRIPT>");
}
Thanks in advance
Adrian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
+------------------------------------------------+
| Julie Meloni (jcm@i2ii.com) |
| Tech. Director, i2i Interactive (www.i2ii.com) |
| |
| "PHP Essentials" & "PHP Fast & Easy" |
| http://www.thickbook.com/ |
+------------------------------------------------+