In message <[EMAIL PROTECTED]>, Joshua
<[EMAIL PROTECTED]> writes
>Hello,
>
>I was hoping someone could help me with my PHP script I have listed 
>below. It seems to go through the entire script and navigates to the 
>/messagesent.htm page, however, no records are being inserted in the 
>database.... what gives? 

>$con = pg_connect("host=127.0.0.1 port=5432 dbname=dbone user=joshua 
>password=jnw08jnw") or
>die("Couldn't Connect ".pg_last_error());

The PHP manual recommends including the connection resource, as in

>  pg_query($con, "INSERT INTO demoreques

Personally, I would add 

if pg_query(...

or some way of checking the result.


>  pg_query("INSERT INTO demoreques
>t (name, title, company, address, 
>city, state, zip, phone, fax, email, quote, mod_guestprospecting, 
>mod_fni, mod_lease, mod_parts, mod_service, mod_payroll, mod_vehinvmgt, 
>mod_accounting, mod_appraisal_control, mod_autocreditbureau, 

The fields don't match the data - what about company, address, city,
state, zip?  And you have $email in twice.

>mod_leaserresidual, mod_creditbureau, workstations, forms)
>VALUES ('$name', '$title', '$email', '$phone', '$fax', '$email', 
>'$quote', '$mod1', '$mod2', '$mod3', '$mod4', '$mod5', '$mod6', '$mod7', 
>'$mod8', '$mod9', '$mod10', '$mod11', '$mod12', '$workstations', 
>'$forms')");


At the very least, you should have
if (resultOK) here, before
> header("Location: http://www.mywebsite.com/messagesent.htm";);


-- 
Pete Clark

Sunny Andalucia
http://hotcosta.com/Andalucia.Spain

Reply via email to