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.

The Database Forum


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



Reply
Somethings wrong, somethings very wrong.
Old 09-17-2008, 07:11 PM Somethings wrong, somethings very wrong.
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
$Txt returns empty!
Code:
$SQL="SELECT * FROM PreviewText"; 
$Txts = mysql_query($SQL);
while($Txt = mysql_fetch_array($Txts));
{
  $SQL="Select * From Texts Where TemplateID = $TemplateID and TextID = '$Txt[1]'";
  $result = mysql_query($SQL);
  $row = mysql_fetch_row($result);
  $PosLeft = $row[2]*$Inch; 
  $PosBottom = $row[3]*$Inch;
  $PosWidth  = $row[4]*$Inch;
  $PosHeight  = $row[5]*$Inch;
  $Font  = "$row[6]'";
  $Color  = "'$row[7]'";
  $Shadow = "'$row[8]'";
  //Create Text Overlay Image
  imagettftext($overlay,36,0,$PosLeft,$PosBottom,$red ,'Fonts/grilcb',$Txt[2]);
}
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-24-2008, 12:25 PM Re: Somethings wrong, somethings very wrong.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,523
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
How do you know WHAT each element of the $Txt array holds when you use SELECT * ???

reorder the table columns and your query goes totally belly up!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-25-2008, 02:55 AM Re: Somethings wrong, somethings very wrong.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
OMFG

while($Txt = mysql_fetch_array($Txts)) ; <---- LOOK HERE!!!11

You never get into that cycle!
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 09-25-2008, 02:56 AM Re: Somethings wrong, somethings very wrong.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Chris, is there any significant use of reordering tables in means of performance?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 09-25-2008, 07:40 AM Re: Somethings wrong, somethings very wrong.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,523
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
None that I know of, but it won't be the first time tables have been restructured and the programmer has assumed it will never happen.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-25-2008, 07:57 AM Re: Somethings wrong, somethings very wrong.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
That's why I prefer mysql_fetch_object() and then refer as $var->field_name
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Somethings wrong, somethings very wrong.
 

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.29170 seconds with 12 queries