RE: [PHP] edit record in mysql and receive error
| From: | Rick Emery | Date: | Wed, 20 Mar 2002 13:42:46 +0000 |
| Subject: | RE: [PHP] edit record in mysql and receive error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-89325@lists.php.net to get a copy of this message | ||
We can't read your mind.
What kind of error do you get?
Second, I recommend that you ALWAYS add the die() clause to your mysql
function calls
-----Original Message-----
From: Manu Verhaegen [mailto:m.verhaegen@compuver.be]
Sent: Wednesday, March 20, 2002 7:16 AM
To: 'Php-General (E-mail)
Subject: [PHP] edit record in mysql and receive error
Hi,
I have the following records in my table dnsDNS
Record 1 :
Login = company1
ip = 10.123.100.111
Record 2 :
Login = company2
ip = 10.123.101.111
I want to update recordnumber 1
I receive error
<?php
$ip="10.10.9.100";
$company="company1";
$host="localhost";
$user="username";
$password="abcdef";
$database="database1";
$query = "update dynDNS SET IP='$ip' where Login='$company'";
mysql_connect ($host, $user, $password);
mysql_select_db($database);
$result=mysql_query($query);
if ($result == 0) {
echo("error");
echo("<BR>");
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php