Page 1 of 1

Confusseeddd!!! PHP help

Posted: Thu May 13, 2010 4:48 pm
by august
Can anyone see where I'm going wrong ... it works fine from my home computer with the same database etc, but then when I take it to my other location, with the same database, exactly, it just doesnt work, starting to think i have made a slight error and just cant spot it?

Code: Select all

if ($outcome == "Sale")

{
	$insertsale="INSERT into sold (transferid, datasource, lastupdatedby, title, firstname, lastname, address1, postcode, homenumber, mobilenumber, worknumber, numberofcreditors, totaldebt, monthlypayments, debtinfo, struggling, bandc, carvaninsurance, gaselectricquote, outcome, transferedto, agent, results, notes, soldby) VALUES ('$transferid','$datasource','$repname','$title','$firstname','$lastname','$address1','$postcode','$homenumber','$mobilenumber','$worknumber','$numberofcreditors','$totaldebt','$monthlypayments','$debtinfo','$struggling','$bandc','$carvaninsurance','$gaselectricquote','$outcome','$transferedto','$agent','','','$soldby')";

mysql_query($insertsale) or die("Could not insert sale");

Re: Confusseeddd!!! PHP help

Posted: Thu May 13, 2010 4:53 pm
by hallsofvallhalla
what is the error you are getting?

Also you have insert into sold but I do not see a sold table..

Re: Confusseeddd!!! PHP help

Posted: Fri May 14, 2010 8:04 am
by Chris
Try this:

Code: Select all

if ($outcome == "Sale")
{
   $insertsale="INSERT INTO `sold`
                       (`transferid`,
                     `datasource`,
                     `lastupdatedby`,
                     `title`,
                     `firstname`,
                     `lastname`,
                     `address1`,
                     `postcode`,
                     `homenumber`,
                     `mobilenumber`,
                     `worknumbe`r,
                     `numberofcreditors`,
                     `totaldebt`,
                     `monthlypayments`,
                     `debtinfo`,
                     `struggling`,
                     `bandc`,
                     `carvaninsurance`,
                     `gaselectricquote`,
                     `outcome`,
                     `transferedto`,
                     `agent`,
                     `results`,
                     `notes`,
                     `soldby` )
                    VALUES
                    ('$transferid',
                     '$datasource',
                     '$repname',
                     '$title',
                     '$firstname',
                     '$lastname',
                     '$address1',
                     '$postcode',
                     '$homenumber',
                     '$mobilenumber',
                     '$worknumber',
                     '$numberofcreditors',
                     '$totaldebt',
                     '$monthlypayments',
                     '$debtinfo',
                     '$struggling',
                     '$bandc',
                     '$carvaninsurance',
                     '$gaselectricquote',
                     '$outcome',
                     '$transferedto',
                     '$agent',
                     '',
                     '',
                     '$soldby')";

    mysql_query($insertsale) or die(mysql_error());
} 
 

Re: Confusseeddd!!! PHP help

Posted: Fri May 14, 2010 5:27 pm
by KunoNoOni
hallsofvallhalla wrote:what is the error you are getting?

Also you have insert into sold but I do not see a sold table..

That's because we're looking inside the sold table.


-KunoNoOni

Re: Confusseeddd!!! PHP help

Posted: Fri May 14, 2010 7:47 pm
by hallsofvallhalla
well that will teach me to skim a topic! I seriously need to spend more time reading posts. Dummy me.