Re: [PHP-DB] Can't get data back into the database

2002-08-21 Thread Patrick Kirk

Patrick Kirk said: Good Lord - its eaten contacts.php again!







Contacts// 
>Contacts /
 ?grouping=> /
  



First Name:

Last Name:

Organisation:



Home Phone:

Work Phone:

Mobile Phone:



Email:

Title:

Date of birth:




Home Address:


Work Address:


Grouping:


Club
Players
Archives
Enterprise
Business
Children
Partners
Resources
Personal
Elizabeth Mews


Notes:




Contacts / $grouping / $first_name
$last_name";

  echo "Record updated/edited!";



} elseif ($delete) {

// delete a record
echo "Contacts / $grouping";

$sql = "DELETE FROM people WHERE person_id=$person_id";

$result = mysql_query($sql);


echo "$sql Record deleted!";






} else {

?>
Contacts

Filter by Grouping: 

>

Grouping: 
Club
Players
Archives
Enterprise
Business
Children
Partners
Resources
Personal
Elizabeth Mews







Contacts/$grouping";

echo "Contacts / $grouping";

echo " Add a New Contact ";

echo "First
Name   Last
Name   Organisation   Details";
$alternate = "2";
while ($row = mysql_fetch_array($result)) {
$first_name = $row["first_name"];
$last_name = $row["last_name"];
$organisation = $row["organisation"];
$person_id = $row["person_id"];

if ($alternate == "1") {
$color =  "#A0B8C8";
$alternate = "2";
}
else {
$color =  "#ff";
$alternate = "1";
}
echo "$first_name   $last_name   $organisation    More... ";

}
// echo "";
echo "";
}   // Function printGrouping

?>




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Can't get data back into the database

2002-08-21 Thread Patrick Kirk

contacts.php appears to have been chewed up ... fresh copy.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Can't get data back into the database

2002-08-21 Thread Patrick Kirk

Hi all,

I'm writing this as a plugin for Squirrelmail.  Its a simple address book
but will have a lot of advantages once I've integrated it properly.  I'm
learning PHP so thought it would be a good first project.

In terms of displaying records, it works a treat. Sadly, I can't get
updating from it to work - the logic seems to break down when I edit an
entry in the form and try to put that entry back into the database.  I've
been poking away at this problem for a day or so, I'm stuck and would
appreciate a suggestion as to why the 'submit' button doesn't call
PHP_SELF with the updated values.

Thanks in advance.  Apologies to anyone who is upset at the 9k attachment.

Patrick



DROP TABLE IF EXISTS people;

CREATE TABLE people (

   person_id tinyint(4) unsigned NOT NULL auto_increment,
   first_name varchar(30) NOT NULL,
   last_name varchar(30) NOT NULL,
   dob date DEFAULT '-00-00' NOT NULL,
   home_address varchar(255) NOT NULL,
   work_address varchar(255),
   home_phone varchar(30) NOT NULL,
   work_phone varchar(30) NOT NULL,
   mobile_phone varchar(30) NOT NULL,
   email1 varchar(30) NOT NULL,
   grouping varchar(30) NOT NULL,
   comments varchar(255) NOT NULL,
   organisation varchar(30) NOT NULL,
   title varchar(30) NOT NULL,
   PRIMARY KEY (person_id)

);



## last_name, first_name, title, organisation, work_phone, home_phone, mobile_phone, 
email1, home_address, work_address, grouping, notes--=_20020821161424_41493
Content-Type: application/octet-stream; name="config.php"
Content-Disposition: attachment; filename="config.php"
Content-Transfer-Encoding: base64

PD9waHAKCi8qIHVzZWZ1bCB2YXJpYWJsZXMgdGhhdCBnZXQgdXNlZCBhZ2FpbmEgbmQgYWdhaW4g
Ki8KCiRob3N0bmFtZSA9ICJsb2NhbGhvc3QiOwokcGFzc3dvcmQgPSAidXNlciI7ICAgICAgICAg
ICAgICAgICAgICAgICAgICAvLyBteXNxbCBwYXNzd29yZAokdXNlciA9ICJ1c2VyIjsgICAgICAg
ICAgICAgICAgICAgICAgICAvLyBteXNxbCB1c2VyCiRkYm5hbWUgPSAiY29udGFjdHMiOyAgICAg
ICAgICAgICAgICAgICAgIC8vIG15c3FsIGRhdGFiYXNlIG5hbWUKJHBpY3R1cmUgPSJicmhpbm84
YS5qcGVnIjsgICAgICAgICAgICAgICAgICAgIC8vIGRpc3BsYXllZCBpbiB1cHBlciBsZWZ0IGZy
YW1lCiR0aXRsZV9tc2cgPSAiV2VsY29tZSB0byB0aGUgS2lyayBDb250YWN0cyBEYXRhYmFzZSAi
OyAgICAgICAgICAgICAgICAvLyBUaXRsZSBNZXNzYWdlCgoKPz4K



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php