I am trying to submit entries in a form to a database. I am using
[code[
action="$_SERVE R[PHP_SELF]"
[/code]
within my submission form and -
$_POST['value-to-be-submitted']
-
I am getting the connection to the database but I my script is not executing, probably due to a syntax error which I can't see.
here is the code, first the submission page, then the php script
submission page
php script -
<?php
-
$connect=pg_connect("dbname=AlliedAutoParts host=localhost user=User password=password");
-
if (!pg_connection_busy($connect))
-
{
-
$result=pg_query($connect, "insert into customer values($_POST['customer_name'], $_POST['customer_address'], $_POST['customer_contact_no'])");
-
}
-
echo "New customer added";
-
?>
-
Using alerts to debug I am getting OK,1, 2, 3, 4, 200, "blank alert".
rpjd
2 1773
Hi,
please put this line for getting the error, it will be easier if u r getting the error printed in ur page.
[PHP]ini_set('displa y_errors', '1');[/PHP]
please let us know whats the error u r getting.
susen
Hi,
please put this line for getting the error, it will be easier if u r getting the error printed in ur page.
[PHP]ini_set('displa y_errors', '1');[/PHP]
please let us know whats the error u r getting.
susen
I seemed to have solved the error here -
<?php
-
$connect=pg_connect("dbname=AlliedAutoParts host=localhost user=User password=password");
-
if (!pg_connection_busy($connect))
-
{
-
$result=pg_query($connect, "insert into customer values('$customer_name', '$customer_address', '$customer_contact_no')");
-
}
-
echo "New customer added";
-
?>
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: |
last post by:
Hello,
Sorry to ask what is probably a simple answer, but I am having problems
updating a table/database from a PHP/
PHTML file. I can Read From the Table, I can Insert into Table/Database, But
not update. Here is a copy of the
script I am using. I do not know what version of MySQL my host is running
nor do I have Shell Access to it. I
|
by: Jason |
last post by:
Let's say I have an html form with 20 or 30 fields in it. The form
submits the fields via POST to a php page which updates a table in a
database with the $_POST vars. Which makes more sense?
1) simply UPDATING the values for all fields in the table, whether or
not any particular field has actually changed
2) running a second SELECT statement and comparing the $_POST vars to
the returned values, and only UPDATING those that have...
|
by: Ray Holtz |
last post by:
I have a form that shows a single record based on a query criteria.
When I click a button it is set to use an append query to copy that
record to a separate table, then deletes the record from the first
table. Both tables have a 'DateTime' field that shows when it was last
updated using the Now function.
What I am trying to do is get the 'DateTime' field updated after the
append query copies it to the new table. I have tried updating...
|
by: chrisc |
last post by:
Hello,
Im using redemption in a database created in ms access.
At the moment emails are generated depending on various actions within
a database. To give an example:
Public Const Email_StencilOrderer = "CA" 'Joe Bloggs
Then later on when an action is taken I will call this like so:
|
by: jaYPee |
last post by:
does anyone experienced slowness when updating a dataset using
AcceptChanges?
when calling this code it takes many seconds to update the database
SqlDataAdapter1.Update(DsStudentCourse1)
DsStudentCourse1.AcceptChanges()
i'm also wondering because w/ out AcceptChanges the data is still save
into the database and it is now faster.
| |
by: bill |
last post by:
In an application I am writing the user can define a series of
steps to be followed. I save them in a sql database using the
field "order" (a smallint) as the primary key.
(there are in the range of 20 steps)
On the admin page the steps are listed, in "order" order and the
user can create new steps and assign an order and all is well.
The problem may come in using a renumber function which should
take the steps in their current order...
|
by: Dave |
last post by:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.
Thanks for your help already,
Dave
|
by: Spoogledrummer |
last post by:
Hi it's me again, still working on the sam 5 minute problem so feeling kind of thick now.
I've dumped the idea of using a textarea for now and am using a textbox instead but am struggling when it comes to updating the database, I've tried several different methods and the one I'm currently battling with is as follows:
%
set objconn=server.CreateObject("ADODB.connection")
objconn.Mode=3
objconn.Open ("DSN=localserver; User ID=blah;...
|
by: stepterr |
last post by:
I have a form that is built based on a query. Everything is working except when I submit the form the radio buttons are only updating the first row in my database. dcategory and dthumbnail are two radio buttons that I have for each one of the rows in the table. I've tried using a hidden input object for each of the radio button groups to store the values in but clearly I'm having a mental block because I can't get that to work right either. So...
|
by: =?Utf-8?B?VmFuZXNzYQ==?= |
last post by:
Hi All!
I am with a situation where I am not getting the right updating to the
form's fields. The situation is the following one:
I have one combobox and one textbox. I am using the CurrentChanged event of
the BindingSource of the combobox to update the textbox. When selecting an
item in the combobox or when selecting a row in the grid, it is updating the
textbox correctly. The problem is when I apply a filter in the grid, and then...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |