RE: [PHP] insert not working
-Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: 05 May 2005 10:16 To: php-general@lists.php.net Subject: [PHP] insert not working $query = "INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax', '$email', '$web', '$add_info')"; $result= mysql_query($query); if($result){ echo "sucess"; } why yould this not work? I can retrievethe data but not write any data to the database?? http://uk2.php.net/manual/en/function.mysql-query.php Does the account you are using have INSERT permission on the database? Does the insert statement work in mySQL's query window? R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com E&OE ** ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] insert not working
Hi, On 5/5/05, Ross <[EMAIL PROTECTED]> wrote: > $query = "INSERT INTO sheet1 (title, fname, sname, job_title, organisation, > street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES > ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', > '$postcode', '$city', '$telephone', '$mobile', '$fax', '$email', '$web', > '$add_info')"; > >$result= mysql_query($query); > if($result){ > echo "sucess"; > } > > why yould this not work? I can retrievethe data but not write any data to > the database?? Please mention the error message clearly. what error are you getting. I think there might be some data type mismatch between ur php code and mysql data type > R. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- bala> balachandar muruganantham blog> lynx http://chandar.blogspot.com web> http://www.chennaishopping.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] insert not working
Did you check for proper permissions in the user and db tables in the user database? Prathap -- Original Message --- From: "Ross" <[EMAIL PROTECTED]> To: php-general@lists.php.net Sent: Thu, 5 May 2005 10:15:52 +0100 Subject: [PHP] insert not working > $query = "INSERT INTO sheet1 (title, fname, sname, job_title, > organisation, street, postcode, city, telephone, mobile, fax, email, > web, add_info) VALUES > ('$title', '$fname', '$sname', '$job_title', '$organisation', > '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax', > '$email', '$web', '$add_info')"; > >$result= mysql_query($query); > if($result){ > echo "sucess"; > } > > why yould this not work? I can retrievethe data but not write any > data to the database?? > > R. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --- End of Original Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] insert not working
Ross wrote: $query = "INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax', '$email', '$web', '$add_info')"; $result= mysql_query($query); if($result){ echo "sucess"; } else { echo mysql_error() . "\n$query"; } why yould this not work? I can retrievethe data but not write any data to the database?? R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] insert not working
$query = "INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax', '$email', '$web', '$add_info')"; $result= mysql_query($query); if($result){ echo "sucess"; } why yould this not work? I can retrievethe data but not write any data to the database?? R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php