Click here to get back home

Replace variables in resulting query

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Replace variables in resulting query Jim 07-25-2006
Posted by Jim on July 25, 2006, 12:58 pm
Please log in for more thread options
Hi,

I have the results of a query that as follows. I want to replace $prod
with the value of the variable - how can I get php to do that?

Select total_errors as num from ftr_summary_data where
ftr_product_platform= $Product and Project=$Project'

Select total_errors as denom from ftr_summary_data where
ftr_product_platform= '$Product' and Project='$Project'


Jim


Posted by torpecool on July 25, 2006, 4:06 pm
Please log in for more thread options
I'm not sure, but this is something you may want to try.

If your query is in quotes, here is what it should look like:

"SELECT tota_errors AS num FROM ftr_summary_data WHERE
ftr_product_platform = ".$Product." AND Project = ".$Project."

I hope this helps.
Andy


Jim wrote:
> Hi,
>
> I have the results of a query that as follows. I want to replace $prod
> with the value of the variable - how can I get php to do that?
>
> Select total_errors as num from ftr_summary_data where
> ftr_product_platform= $Product and Project=$Project'
>
> Select total_errors as denom from ftr_summary_data where
> ftr_product_platform= '$Product' and Project='$Project'
>
>
> Jim


Similar ThreadsPosted
Replace Function with Wildcards? July 6, 2006, 4:51 pm
replace function and string comparison June 8, 2006, 4:17 am
Find and replace of portions of text strings April 4, 2006, 11:34 am
Macro Variables April 18, 2006, 11:37 am
Declaring variables June 28, 2006, 4:39 pm
Inserting variables in mySQL table! June 25, 2005, 9:11 am
User defined variables question July 10, 2007, 8:20 pm
Reading Variables available in shell program into MySQL September 26, 2005, 12:39 am
Help with Stored Proc in mysql varchar variables August 29, 2006, 4:36 am
MySQL variables, modifying Microsoft SQL sequence insert for use in mysql October 7, 2005, 10:54 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap