You are here: 2 statements in to 1 « PHP SQL « IT news, forums, messages
2 statements in to 1

Posted by Brian on 05/20/06 17:13

I'm not sure if this can be done, but I would like to turn 2 statements in
to 1

The 1st one returns 2 fields "Bank" and "Advertmode"



SELECT bank1, advertmode1 FROM conf WHERE (id = "XYZ")



The 2nd one uses the "Bank" field to know what to get and the "Advertmode"
is used to set a flag



SELECT * FROM profiles WHERE (customer = "TheCustomers") AND (profile_name1
= "Bank1")



I need to end up with 4 fields that I can use



filename1 (from profiles table)

description1 (from profiles table)

supplier1 (from profiles table)

advertmode1 (from conf table)





This statement will be run 14 times to gather the fields 1 to 14 (eg
filename1, filename2, filename3 etc) so I am trying to make it quicker to
run



Can this be done?







Brian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация