Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Please help, losing my mind!!!
Old 09-17-2008, 10:45 PM Please help, losing my mind!!!
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
This is my code:

Code:
 
<?php
$conn = mysql_connect("xxx","xxx","xxx"); 
mysql_select_db("xxx",$conn);
$ClientID = $_COOKIE["Brag_Flag_user"];
//Get Project Info
$SQL="Select * From Projects where ClientID = $ClientID and Status = 'Current'";
$result = mysql_query($SQL);
$row = mysql_fetch_array($result);
$ProjectID = $row[0];
$TemplateID = $row[2];
//Store Input Text
$TextID = $_GET["TextID"];
$Text = $_GET["Text"];
$SQL="Update ProjectText Set Text = '$Text' Where ProjectID = $ProjectID and TextID = $TextID";
mysql_query($SQL);
 
//Scaling to match Preview
$Inch = 24;
$overlay = imagecreatefrompng("Images/Overlay_Blanks/24x36.png");
$red = imagecolorallocate($overlay, 255, 0, 0);
$black = imagecolorallocate($overlay, 0, 0, 0);
 
//Set Overlay Destination
$TextOverlays = "Images/Text_Overlays/$ProjectID.png";
$SQL="Select TxtFldCnt from Templates Where TemplateID = $TemplateID";
$result=mysql_query($SQL);
$row=mysql_fetch_row($result);
$TxtFldCnt= $row[0];
for ($i=1;$i<=$TxtFldCnt;$i++);
 {
  //Get Stored Text
  $SQL = "Select PreviewText . Text , Texts . * From PreviewText Inner Join Texts on PreviewText . TextID = Texts . TextID Where PreviewText . TextID = $i And PreviewText . ProjectID = $ProjectID And Texts . TemplateID = $TemplateID";
$result=mysql_query($SQL);
$row = mysql_fetch_array($result);
$PosLeft = $row[3]*$Inch; 
$PosBottom = $row[4]*$Inch;
$PosWidth  = $row[5]*$Inch;
$PosHeight  = $row[6]*$Inch;
$Font  = "Fonts/".$row[7];
$Color  = $row[8];
$Shadow = $row[9];
  echo "$overlay,36,0,$PosLeft,$PosBottom,$red ,$Font,$row[0]";
  //Create Text Overlay Image
  imagettftext($overlay,36,0,$PosLeft,$PosBottom,$red ,$Font,'$row[0]');
 }
 
//Save TextOverlay
imagesavealpha($overlay, true);
imagepng($overlay,$TextOverlays);
//Set Destination for Preview Image
$preview = "Images/Previews/$ProjectID.png";
//Create Copy of Project Template for Project Preview
$ProjectPreview = imagecreatefrompng("Images/Project_Templates/$ProjectID.png");
//Create Copy of Photo Overlay
$Photo = imagecreatefrompng("Images/Photo_Overlays/$ProjectID.png");
//Create Copy of Text Overlay
$Text = imagecreatefrompng("Images/Text_Overlays/$ProjectID.png");
//Paste Text Overlay 
imagecopy($ProjectPreview,$Text,0,0,0,0,570,864);
//Paste Photo Overlay
imagecopy($ProjectPreview,$Photo,0,0,0,0,570,864);
//Save Preview
imagesavealpha($ProjectPreview, true);
imagepng($ProjectPreview,$preview);
?>
You will se in the red portion the query string refers to the variables $ProjectID, TemplateID and $i. I can echo these values and they are there. When I echo the SQL string it comes out like this:

Code:
Select PreviewText . Text , Texts . * From PreviewText Inner Join Texts on PreviewText . TextID = Texts . TextID Where PreviewText . TextID = And PreviewText . ProjectID = And Texts . TemplateID =
What am I doing wrong?

Last edited by Sleeping Troll; 09-17-2008 at 11:10 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-19-2008, 04:39 AM Re: Please help, losing my mind!!!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
remove the spaces between the tablenames, the fullstops (periods) and the fieldnames
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Please help, losing my mind!!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10196 seconds with 12 queries