PDA

View Full Version : mysql / php syntax error


leonthelion
10-29-2006, 06:27 AM
trying to load a bunch of variables from Flash into mysql. I can dynamically target the database column names easily enough, but can't do the same for the $_POST variables... any help?

I just want to replace the 1 character with variable $e contents throughout most of the _POST references

$e=1;

$sql="INSERT INTO projects
(date,
time,
name,
text1Text,
text1X,
text1Y,
text1Font,
pickMaterial,
shape,
pickThickness,
pickQty ,
backgroundColour,
text1Background,
xtraImg".$e."Name,
xtraImg".$e."X,
xtraImg".$e."Y,
xtraImg".$e."Width,
xtraImg".$e."Height,
xtraImg".$e."Alpha,
xtraImg".$e."Rotation,
xtraImg".$e."originalWidth,
xtraImg".$e."originalHeight,
xtraImg".$e."originalX,
xtraImg".$e."originalY,
xtraImg".$e."originalAlpha,
xtraImg".$e."originalRotation) VALUES
('$scoredate',
'$scoretime',
'$_POST[projectName]',
'$_POST[text1Text]',
'$_POST[text1X]',
'$_POST[text1Y]',
'$_POST[text1Font]',
'$_POST[pickMaterial]',
'$_POST[shape]',
'$_POST[pickThickness]',
'$_POST[pickQty]',
'$_POST[backgroundColour]',
'$_POST[text1Background]',
'$_POST[xtraImg1Name]',
'$_POST[xtraImg1X]',
'$_POST[xtraImg1Y]',
'$_POST[xtraImg1Width]',
'$_POST[xtraImg1Height]',
'$_POST[xtraImg1Alpha]',
'$_POST[xtraImg1Rotation]',
'$_POST[xtraImg1originalWidth]',
'$_POST[xtraImg1originalHeight]',
'$_POST[xtraImg1originalX]',
'$_POST[xtraImg1originalY]',
'$_POST[xtraImg1originalAlpha]',
'$_POST[xtraImg1originalRotation]')" ;

leonthelion
10-29-2006, 07:30 AM
and once again on the load script:

for ($t=1;$t<13;$t++){
echo "&xtraImg".$t."Name=$nt[xtraImg1Name]";
echo "&xtraImg1X=$nt[xtraImg1X]";
echo "&xtraImg1Y=$nt[xtraImg1Y]";
echo "&xtraImg1Width=$nt[xtraImg1Width]";
echo "&xtraImg1Height=$nt[xtraImg1Height]";
echo "&xtraImg1Alpha=$nt[xtraImg1Alpha]";
echo "&xtraImg1Rotation=$nt[xtraImg1Rotation]";
echo "&xtraImg1originalWidth=$nt[xtraImg1originalWidth]";
echo "&xtraImg1originalHeight=$nt[xtraImg1originalHeight]";
echo "&xtraImg1originalX=$nt[xtraImg1originalX]";
echo "&xtraImg1originalY=$nt[xtraImg1originalY]";
echo "&xtraImg1originalAlpha=$nt[xtraImg1originalAlpha]";
echo "&xtraImg1originalRotation=$nt[xtraImg1originalRotation]";
}

How do I use variables on the right hand side of the equation, inisde the brackets